[pve-devel] introduce linked disks

Stefan Priebe - Profihost AG s.priebe at profihost.ag
Wed Dec 19 10:40:44 CET 2012


Hi,

the first things are working. But i've problems to mark the owner disk 
as shared. This is needed so that i can block deletion on owner vm as 
long as the disk is shared.

So right now i have:
VM: 123
scsi4: cephkvmpool1:vm-123-disk-4,cache=none,size=32G

Attach the disk to another VM:
~# /usr/sbin/qm set 105 -scsi1 cephkvmpool1:vm-123-disk-4

While doing this i want to mark the disk in vm 123 as shared=yes. This 
works fine as long as VM 123 is on the same host.

I tried to use the following code but this only works locally:

my $oconf = PVE::QemuServer::load_config($owner);

...
# find correct drive in owner vm
# mark this drive as shared=yes
...

PVE::QemuServer::update_config_nolock($owner, $oconf);

After that:
VM: 123
scsi4: cephkvmpool1:vm-123-disk-4,cache=none,size=32G,shared=yes

VM: 105
scsi1: cephkvmpool1:vm-123-disk-4

Greets,
Stefan

Am 19.12.2012 05:42, schrieb Dietmar Maurer:
>> thanks. I think I need to mark a disk as shared - so that i can block deletion
>> whioe shared.
>
> Again, it is marked shared if the 'owner == 0' (that is the idea).
>
>> Does the API allow to modify a VM config running on host B from host A?
>
> No, that would we dangerous because it does not lock the VM correctly.
>
> But the API connects to the correct node to change things.
>



More information about the pve-devel mailing list