[libvirt] Are there interfaces to change IP address of given domain before it runn

Daniel P. Berrange berrange at redhat.com
Tue Nov 25 21:37:47 UTC 2008


On Tue, Nov 25, 2008 at 12:57:06PM -0800, Bryan McLellan wrote:
> On Tue, Nov 25, 2008 at 4:11 AM, Ian jonhson <jonhson.ian at gmail.com> wrote:
> > So, I wonder there are any solution to guarantee that
> > both VM instances would be given different IP address
> > after they are started.
> 
> Use DHCP, and ensure that when you create the domain configuration xml
> file for the second instance that you remove the MAC address lines
> before you define it in virsh so libvirt generates new MAC addresses
> for the copies.

Seconded - DHCP is your friend. Aside from MAC address, when cloning
VMs you must also change name, UUID, posibly VNC port if hardcoded.
To automate this, we provide a virt-clone tool. It won't touch anything
inside the guest, but it'll take care of the disk copy and changing all
neccessary bits of the XML config.

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the libvir-list mailing list