Re: Automatically assign static ipv4 via dhcp to new VMs

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

 



On 10/18/2013 12:31 AM, Tim wrote:
> Thanks for the hint with net-update, thats exactly that what I was
> looking for.
>
> Am 07.10.2013 13:10, schrieb Laine Stump:
>> Fortunately, in libvirt 0.10.0 and later (I think that is the version it
>> was added) you can use the "virsh net-update" command to add net static
>> host entries immediately without restarting the network; something like
>> this:
>>
>>   virsh net-update MyGuest --live internet add \
>>     ip-dhcp-host "<host mac='AA:BB:CC:DD:EE:FF' ip='192.168.122.2'
>> name='foobar'/>"
>>

I just happened across this message when going through the backlog and
noticed that I forgot to add "--config" to the above commandline -
without --config, the new entry will only survive until the network is
destroyed (e.g. the host is rebooted), after which it will be lost.
Assuming you've already added several hosts without using --config, you
can transfer them into the permanent network config like this:

  virsh net-dumpxml MyGuest
   ....
  virsh net-edit MyGuest
   [cut-paste the <host> lines from the dumpxml output into the
configuration file]

Sorry for the omission (and any surprises it may have caused).

_______________________________________________
libvirt-users mailing list
libvirt-users@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvirt-users




[Index of Archives]     [Virt Tools]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux