Disk hotplug and snapshots

Livnat Peer lpeer at redhat.com
Tue Mar 6 14:35:24 UTC 2012


On 06/03/12 12:42, Federico Simoncelli wrote:
> ----- Original Message -----
>> From: "Mike Kolesnik" <mkolesni at redhat.com>
>> To: "Federico Simoncelli" <fsimonce at redhat.com>
>> Cc: "oVirt Arch" <arch at ovirt.org>
>> Sent: Tuesday, March 6, 2012 10:47:57 AM
>> Subject: Re: Disk hotplug and snapshots
>>
>>> Hi,
>>>  looking at the disk hotplug feature in the wiki I was wondering
>>>  how
>>> that fits with the current implementation of the snapshots on the
>>> engine
>>> side.
>>> As far as I know the snapshots are at VM level now (no sigle disk
>>> snapshots),
>>> so what happens when you hotplug a new disk (no snapshots) into a
>>> VM
>>> that
>>> already has one or more snapshots? (and the other way around if
>>> possible).
>>
>> What do you mean by 'hotplug'?
>> By feature description, the disk is always part of VM even if it's
>> unplugged.
>> This is not the same as adding/removing disk to/from VM..
> 
> The real value of this feature is being able to dynamically add and
> remove disks from a running VM.

There are 2 different usages to this feature one of them is what you
described above and the other is being able to start a VM without a
specific disk but still have the disk connected to the VM (and have it
available as part of the export flow for example).

The API the engine exposes uses a little different terminology - we have
activate/deactivate disk and attach/detach disk.

The implementation of activate/deactivate a disk are either update the
engine DB if the VM is down or hot plug the disk if the VM is up.

The implementation of attach/detach is as follows - when a user attaches
a disk he can choose if he wants to attach it as active or not, when a
user detach a disk if the disk is active the user will get a warning in
the UI, after confirming he wants to detach the disk inspite of it being
active, the implementation is to unplug and detach the disk from the VM.

> Even if technically there's a difference (and btw only in the specific
> implementation in the engine) between hotplugging and adding/removing
> disks to/from a VM, they'll often be used together.
> 
>> Snapshots should contain configuration which states if disk is
>> plugged/unplugged - so if this configuration is present, it is used
>> to determine the state of disks at that snapshot.
>>
>> Snapshots also contain a list of the disks that existed when snapshot
>> was taken, so adding a new disk will not affect old snapshots either
>> way.
>> You can then hotplug this disk, but this has no affect on existing
>> snapshots.
>>
>> When you unplug disk, it is still part of the VM and this also
>> doesn't affect past snapshots.
> 
> One of the uses of the disk hotplug is being able to move disks from
> one VM to another. We have two special cases here:
> 
>  1. you're removing a disk that was part of previous snapshot on the
>     old VM (what happens if the user tries to revert? any spurious
>     error since the disk is not there anymore?)

When removing a disk there are two behaviors we should support, remove
with history or remove from active snapshot.

Removing with history is translated to remove the disk and all the
related volumes (except from the base one if it is part of template).

Removing a disk only from active snapshot is a gap at this point and we
need to implement it in the future.

>  2. you're adding the disk that already contains a snapshot to a new
>     VM, and you won't be able to control it anymore (merge, revert).
> 

Today snapshot is a VM snapshot there is no disk snapshot.
Currently the engine blocks detaching a disk if it is part of a VM
snapshot. There are some rejection on this behavior but I am not sure
we'll be able to fix it anytime soon.

> Is this scenario not supported yet?
> 




More information about the Arch mailing list