[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt-users] Possible to change 'machine type' attribute while vm is running?



On 02/09/2015 01:24 PM, Andre Goree wrote:
> Hello.  I'd like to determine if it's possible to change the 'machine
> type' attribute while a vm is running.

In general, no, because it would be a guest-visible change, and guests
don't react well to hardware ABI changing in the middle of a running system.

> 
> For example, I have:
> 
>   <os>
>     <type arch='x86_64' machine='pc-i440fx-trusty'>hvm</type>
>     <boot dev='hd'/>
>   </os>
> 
> I'd like to change that to "machine='pc-i440fx-1.7'" due to an error[1]
> I'm seeing while migrated similar images to another host.
> 
> The only way I've been able to change the machine is by first shutting
> down the vm, making the change, then starting the vm back up.  I'd like
> to avoid that if at all possible.

Sadly, I think a shutdown is the only working approach.  Specifying a
different machine type tells qemu to present different hardware to the
guest, which really only works on fresh guest boots (and even then,
Windows guests tend to want revalidation of the license key).

On the rare case that the different spellings of the machine type do NOT
change the hardware, it might be possible to take a saved guest image,
edit that file to swap out the machine type, and then restore from the
saved image; at least that way you won't lose guest state and the
downtime can be shorter than a full reboot cycle.  But I'm not familiar
enough with pc-i440fx-trusty vs. pc-i440fx-1.7 (both are downstream-only
machine names from Debian, not in upstream qemu) to know if that is the
case.

> 
> I did find the tool "libvirt-migrate-qemu-machinetype", but it doesn't
> seem to do what I think it's intended to do -- i.e., it does NOT change
> the machine type, even after reboot.  Perhaps I'm just using it wrong? 

That tool is not provided by upstream; maybe it is a downstream Debian
tool?  And from the name, that may indeed be the tool that does what you
want?

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]