﻿id,summary,reporter,owner,description,type,status,component,version,resolution,keywords,cc,guest,host
13850,Shareable hdds cannot be attached to a second machine if already attached to a booted machine => fixed in SVN/next maintenance,irvingpop,,"The problem: 
Shareable disks become locked as soon as the first VM boots,  you cannot attach it to any other VMs at this point with shutting down the first VM.

The scenario:

1.  Create a shareable disk  (modifyhd disk.vdi --type shareable)
2.  Attach to a machine (storageattach backend0 --storagectl ""SCSI"" ...  --medium disk.vdi --mtype shareable)
3.  Boot the first machine (backend0)
4.  Attach to a second machine (same command as #2, but to backend1)
error:

{{{
Command: [""storageattach"", ""d596438a-f7cc-4833-bb36-0cbc423b72c0"", ""--storagectl"", ""SCSI"", ""--port"", ""0"", ""--device"", ""0"", ""--nonrotational"", ""on"", ""--type"", ""hdd"", ""--medium"", ""/oc/src/rhcs7/cluster_shared.vdi"", ""--mtype"", ""shareable""]

Stderr: VBoxManage: error: Medium '/oc/src/rhcs7/cluster_shared.vdi' is locked for reading by another task
VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component Medium, interface IMedium, callee nsISupports
VBoxManage: error: Context: ""COMSETTER(Type)(mediumType)"" at line 678 of file VBoxManageStorageController.cpp
VBoxManage: error: Failed to set the medium type

}}}


disk info shows that it is locked:


{{{
VBoxManage showhdinfo cluster_shared.vdi 
UUID:           e9a21ac7-dbfa-4e9b-85e9-42bd7c93593f
Parent UUID:    base
State:          locked read
Type:           shareable
Location:       /oc/src/rhcs7/cluster_shared.vdi
Storage format: VDI
Format variant: fixed default
Capacity:       4096 MBytes
Size on disk:   4098 MBytes
In use by VMs:  backend0.opscode.piab (UUID: 1f05d55f-7d7c-4092-9018-98e0f0613662)
}}}
",defect,closed,virtual disk,VirtualBox 4.3.22,fixed,shareable,,all,all
