0

Using virt-install to deploy a qemu domain (CentOS 7) fails when I set a fixed ip in my kickstart file. It works just fine with dhcp bootproto set in the same kickstart file.

The virt-install command is:

virt-install --hvm --connect qemu:///system \
--network=bridge:br0 --pxe \
--graphics spice --name=kvm_cos7_docker01 \
--ram=3082 --vcpus=1 \
--os-type=linux --os-variant=centos7.0 \
--disk /dev/vgSATA/lv_kvm_cos7-docker01,device=disk,bus=virtio

pxe boots fine, I get to select what I want to do (a kickstart install of centos7) and it gets started as usual but stops when the graphical part should appear. And I get an error about how I should select either "vnc" or "text" to continue but none of those moves the installer forward.

The KS file is very simple, here's the (failing) network part:

network  --bootproto=static --ip=192.168.16.16 \
--netmask=255.255.255.0 --gateway=192.168.16.254 \
--nameserver=192.168.16.254 --device=eth0 \
--ipv6=auto --hostname=docker01.crapco.labs \
--activate

And here's how network looks when using dhcp and all is working fine:

network  --bootproto=dhcp --device=eth0 --ipv6=auto --activate
network  --hostname=docker01.crapco.labs

There's nothing else changed in the kickstart file and I've verified the parameters with the kickstarter reference by redhat. ks reference

The fixed ip in the KS is different from the ip that is used when booting pxe because it falls outside the dhcp scope. I haven't yet tried with an IP inside the dhcp scope and fixed assignement but how/why should that resolve this issue if it does? (will try asap)

Just fixed a lease in the dhcp-scope and set the interface mac address accordingly in the kickstart file:

...
network  --bootproto=static --ip=192.168.16.122 --netmask=255.255.255.0 --gateway=192.168.16.254 --nameserver=192.168.16.254 --device=52:54:00:cf:3d:c4 --ipv6=auto --hostname=docker01.crapco.labs --activate
...

and the virt-install command:

virt-install --hvm --connect qemu:///system --network=bridge:br0,mac=52:54:00:cf:3d:c4 --pxe --graphics spice --name=kvm_cos7_docker01 --ram=3082 --vcpus=1 --os-type=linux --os-variant=centos7.0 --disk /dev/vgSATA/lv_kvm_cos7-docker01,device=disk,bus=virtio

but alas, the problem remains the same: when not using dhcp in the the kickstart file, the install gets blocked completely on choose vnc or text. (none of those actually solve the issue)

Why does it seem impossible to have virt-install use a fixed ip in the kickstart / pxe installation of the domain?

Is the problem elsewhere? No it isn't .. apparently I did not update the correct KS file with the new ip in the DHCP scope...

Conclusion:

spice and kickstart seem to rely on the fact that they're on the same ip address and making the system switch during install time (ip in the KS file) confuses the spice connection I guess.

I don't know if this is something that can be fixed with spice & virt-install as I couldn't find any such option in the graphics for virt-install.

Sure enough the workaround is easy: just make sure the ip used to start pxe installation is the same as the one being used in the installer after switchroot.

lievendp
  • 91
  • 1
  • 1
  • 10
  • woops, I forgot to write summaries for my edits ... this doesn't seem to be alterable afterwards but in short: first edit was about wrong test case and second edit about correction on the test case which lead to my conclusion. – lievendp Feb 12 '17 at 18:56

1 Answers1

0

Guess I'll post this as an answer as well:

spice and kickstart seem to rely on the fact that they're on the same ip address and making the system switch during install time (ip in the KS file) confuses the spice connection I guess.

I don't know if this is something that can be fixed with spice & virt-install as I couldn't find any such option in the graphics for virt-install.

Sure enough the workaround is easy: just make sure the ip used to start pxe installation is the same as the one being used in the installer after switchroot.

lievendp
  • 91
  • 1
  • 1
  • 10