[libvirt] How to avoid failure of migration/restoring/starting if cdrom is ejected inside guest?

Osier Yang jyang at redhat.com
Tue Aug 9 02:07:57 UTC 2011


于 2011年08月09日 02:09, Dave Allan 写道:
> On Mon, Aug 08, 2011 at 11:53:26AM -0600, Eric Blake wrote:
>> On 08/08/2011 09:22 AM, Dave Allan wrote:
>>>> If the medium is ejected inside guest, and the source of the medium
>>>> is removed or renamed. libvirt will still tries to do cgroup setting
>>>> before starting the guest on dest side, that's the real problem. As
>>>> one will think it's reasonable to remove the source if it's
>>>> ejected. And we can't prevent one remove the source during the
>>>> migration (supposing the removing is before libvirt tries to do
>>>> cgroup setting on dest host.)
>>> Agreed, but that's a problem that I don't think we can solve except by
>>> documenting the behavior.  The libvirt documentation has always
>>> clearly stated that the storage configuration must be the same on the
>>> src and dst hosts.  We are discussing altering that constraint here in
>>> the case of medium that has been ejected, but I think we can be clear
>>> that the constraint is not being removed and that a guest's storage
>>> configuration must not be changed while a migration is in progress.
>> I thought the qemu folks were working on a series of patches to make
>> cd tray state part of the migration information.  That is, if you
>> start a migration, then a guest ejects the cd, then the destination
>> will correctly see the ejected cd, even though the destination was
>> started with the tray closed.  That is, libvirt should not have to
>> poll on cd tray state in order to correctly migrate, but should be
>> able to poll on cd tray state in order to report tray state to the
>> curious user.
>>
>> The migration aspect of cd tray state generally has to be solved by
>> qemu - there's nothing libvirt can do if the guest changes cd tray
>> state after migration has started but before it has completed,
>> unless libvirt can poll the source after it has paused but before
>> the destination has been unpaused and issue appropriate monitor
>> commands on the destination to resync state; but that should only be
>> necessary if qemu doesn't migrate cd tray state in the first place,
>> and requires that qemu support tray state monitor commands for
>> libvirt to use.
> Yeah, that was my concern about having the media appear back in the
> drive following migration that I mentioned in my first response.  I
> think we're in agreement--I only think we need to poll for the tray
> state for on migration so that we can correctly decide whether to
> allow the migration if the media backing storage isn't present.  I.e.,
> if the guest has ejected the media from the drive we can permit
> migration if the media isn't present on the dst.
>
> Dave

I'm not sure if we're in agreement, following is my thought

1) trying to solve the problem that ejects the media inside guest
while migration in process (with or without the media source
is removed, if don't remove the media source, we starts guest
on dest with the media inserted incorrectly, if removing it, we
fail early before trying executing the qemu command line while
do cgroup setting) doesn't work.

2) But we can do simple checking just before (not during) migration
takes place, (if the media is ejected, we starts the guest on dest
without the media present).

3) for the report tray status, we need to wait for the qemu patches
are done. The coming patches of "info block" can't provide enough
info for us.

Osier




More information about the libvir-list mailing list