CentOSバージョン毎のvirt-installのextra-argsオプション

概要

virt-installコマンドのextra-argsオプションでサブネットを指定することが出来ますが、
このサブネットの指定がCentOSのバージョンによって異なります。そのメモです。

sudo virt-install \
--connect qemu:///system \
--accelerate \
--name test \
--ram 2048 \
--vcpus=2 \
--nographics \
--disk path=/data/test.img,bus=virtio,size=20,sparse=true \
--network bridge:br0.0001 --mac=54:52:00:00:00:01 \
--network bridge:br0.0002 --mac=54:52:00:00:00:02 \
--location http://example.com/centos/7/os/x86_64/ \
--extra-args='ip=10.0.0.1 netmask=255.255.255.0 gateway=10.0.0.254 dns=10.0.0.53 ks=http://example.com/test.ks ksdevice=eth1 console=tty0 console=ttyS0,115200n8'


extra-argsオプションの指定
CentOS5 netmask
CentOS6 subnet
CentOS7 netmask

※CentOS6はnetmaskではなくsubnetにする必要がある。

CentOS5
netmask=255.255.255.0  


CentOS6
subnet=255.255.255.0


CentOS7
netmask=255.255.255.0