On 08/02/2011 07:06 PM, sethuraman subbiah wrote:
>
I tried changing the disk image and it works fine. But if I try to change
the mac address , I get error: unsupported configuration.
That's correct - changing the MAC address would be a guest-visible
change, with possibly fatal consequences to a guest (your hardware
doesn't change MAC addresses on the fly, so why should your virtual
hardware allow it?).
My aim was to
perform cloning and change the mac of the cloned image and also doing some
changes inside the vm to make sure it obtains a new ip. Is there a
possibility to get this working with the current API ?
Cloning is not a trivial operation. There is no support for cloning a
running machine; it is only safe to clone offline disk images, at which
point, you _can_ modify MAC addresses for the clone, since a guest
booting with a new MAC address is no different than swapping out
hardware while your machine was offline. Virt-manager is able to do
cloning, and it involves multiple libvirt API calls; perhaps studying
that source will give you some better ideas. It is unlikely that
libvirt will ever be able to support cloning in a single API call;
rather it will continue to support enough API to be used in sequence to
do a clone. Likewise, cloning a live machine (even one whose state was
saved by 'virsh save' or 'virsh snapshot') is unlikely to ever be
possible.
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library
http://libvirt.org