VirtualBox

Ticket #19803 (new defect)

Opened 16 months ago

Last modified 16 months ago

Add support for SATA attached read-only (RO/RDONLY) vmdk disks

Reported by: birdy Owned by:
Component: other Version:
Keywords: Cc:
Guest type: all Host type: all

Description

Currently you cannot attach a full raw real harddisk with the RDONLY (read-only) flag set as the VM execution runs into an error:

The I/O cache encountered an error while updating data in medium "ahci-0-1" (rc=VERR_INVALID_HANDLE). Make sure there is enough free space on the disk and that the disk is working properly. Operation can be resumed afterwards.

Error ID: BLKCACHE_IOERR
Severity: Non-Fatal Error

[Copy] [OK]

Pressing OK doesn't allow to continue the execution.

Please fix.

Here's an example VMDK image:

# Disk DescriptorFile
version=1
CID=abcdedfg
parentCID=ffffffff
createType="fullDevice"

# Extent description
RDONLY 800000000 FLAT "/dev/sda" 0

# The disk Data Base
#DDB

ddb.virtualHWVersion = "4"
ddb.adapterType="ide"
ddb.geometry.cylinders="16383"
ddb.geometry.heads="16"
ddb.geometry.sectors="63"
ddb.uuid.image="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
ddb.uuid.parent="00000000-0000-0000-0000-000000000000"
ddb.uuid.modification="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
ddb.uuid.parentmodification="00000000-0000-0000-0000-000000000000"
ddb.geometry.biosCylinders="1024"
ddb.geometry.biosHeads="255"
ddb.geometry.biosSectors="63"

Change History

comment:1 Changed 16 months ago by birdy

From the log:

0:01:43.843226 AioMgr2-N: Request 0x007fb888000b80 failed with rc=VERR_INVALID_HANDLE, migrating endpoint /dev/sda to failsafe manager.
00:01:43.843377 I/O cache: Error while writing entry at offset 34779168768 (4096 bytes) to medium "ahci-0-1" (rc=VERR_INVALID_HANDLE)
00:01:43.843422 VM: Raising runtime error 'BLKCACHE_IOERR' (fFlags=0x6)
00:01:43.843455 Changing the VM state from 'RUNNING' to 'SUSPENDING'
00:01:43.843661 AIOMgr: Endpoint for file '/tmp/sda.vmdk' (flags 00000781) created successfully
00:01:43.843740 AIOMgr: Endpoint for file '/dev/sda' (flags 000c0781) created successfully
00:01:43.920566 PDMR3Suspend: 77 066 090 ns run time
00:01:43.920574 Changing the VM state from 'SUSPENDING' to 'SUSPENDED'
00:01:43.920583 Console: Machine state changed to 'Paused'

comment:2 Changed 16 months ago by birdy

If I attach the same disk via VirtIO SCSI everything works however I don't understand where writes go. VirtualBox allows to write to this disk despite the fact that it's read-only.

comment:3 Changed 16 months ago by birdy

VirtIO doesn't really work, the VM hangs when you try to shut it down:

00:43:07.935662 PDMR3PowerOff: after     0 ms, 1 loops: 1 async tasks - virtio-scsi/0
00:43:07.935747 AioMgr2-N: Request 0x007f934c34e580 failed with rc=VERR_INVALID_HANDLE, migrating endpoint /dev/sda to failsafe manager.
00:43:07.935821 AIOMgr: I/O manager 0x007f934c363750 encountered a critical error (rc=VERR_FILE_AIO_NO_REQUEST) during operation. Falling back to failsafe mode. Expect reduced performance
00:43:07.935834 AIOMgr: Error happened in /home/vbox/vbox-6.1.12/src/VBox/VMM/VMMR3/PDMAsyncCompletionFileNormal.cpp:(1677){int pdmacFileAioMgrNormal(RTTHREAD, void*)}
00:43:07.935836 AIOMgr: Please contact the product vendor
00:43:19.044466 GUI: Request to close active machine-window.
Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use