Closed BurlyLuo closed 15 hours ago
you can change your invocation to prevent cloudinit from setting dhcp for specific interfaces
kcli create vm -i centos7 -P memory=4096 -P disks=[50] -P rootpassword=hive \
-P nets="[{'name':'brnet','ip':'192.168.2.96','netmask':'24','gateway':'192.168.2.1'},{'name':'vppdpdk5','noconf':'true'},{'name':'vppdpdk8','noconf':'true'},{'name':'vppdpdk9',noconf':'true''}]" \
-P cpupinning=['{"vcpus": "0", "hostcpus": "0"}','{"vcpus": "1", "hostcpus": "1"}','{"vcpus": "2", "hostcpus": "2"}','{"vcpus": 3, "hostcpus": 3}'] -P numcpus=4 \
-P cmds='[rm -rf /etc/yum.repos.d/* && curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo && yum -y install net-tools pciutils wget lrzsz && wget http://192.168.2.100/kvm/tools/lseth -P /usr/bin/ && chmod +x /usr/bin/lseth]' vm
side note: you should really use a plan file. Your command line can be rewritten as a plan like this
vm:
type: vm
image centos7
rootpassword: hive
memory: 4096
numcpus: 4
cpupinning:
- vcpus: 0
hostcpus: 0
- vcpus: 1
hostcpus: 1
- vcpus: 2
hostcpus: 2
- vcpus: 3
hostcpus: 3
disks:
- 50
nets:
- name: brnet
ip: 192.168.2.96
netmask: 24
gateway: 192.168.2.1
- name: vppdpdk5
noconf: true
- name: vppdpdk8
noconf: true
- name: vppdpdk9,
noconf: true
cmds:
- rm -rf /etc/yum.repos.d/*
- curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
- yum -y install net-tools pciutils wget lrzsz
- wget http://192.168.2.100/kvm/tools/lseth -P /usr/bin
- chmod +x /usr/bin/lseth vm
Okay, thank you
issue description: when the cloud-init set the BOOTPROTO=dhcp, there will DHCPDISCOVER and wait the replay. but the bridge is not enable the dhcp feature, the network start will be failed and timeout.
so can we set the BOOTPROTO as none or static to avoid the block. thanks.
if change the parameter as static and restart the network service, it worked as expected.
and the service under running status: