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

[libvirt-users] Automatically assign static ipv4 via dhcp to new VMs

Hi guys,

I'm running a KVM/libvirt host in a datacenter and got a fancy IPv4
subnet from my provider. I'm able to assign IPs from that subnet via
dhcp to my VMs:

host01 ~ # virsh net-dumpxml internet
<network connections='3'>
  <forward dev='enp5s0f0' mode='route'>
    <interface dev='enp5s0f0'/>
  <bridge name='virbr1' stp='on' delay='0'/>
  <mac address='52:54:00:13:39:d5'/>
  <ip address='XX.YY.253.2' netmask=''>
      <range start='XX.YY.253.4' end='XX.YY.253.30'/>
      <bootp file='pxelinux.0' server='XX.YY.99.100'/>

What I would like to do:

1) Right know it seems like dnsmasq assigns ip-addresses randomly to
VMs, is there any way to assign them in ascending order?

2) IPs are not statically assigned. Is it possible to add something like
this automatically at the first VM-start to the xml definition?:
<host mac='AA:BB:CC:DD:EE:FF' ip='' name='foobar'/>

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