Cloud-init and ifcfg-eth0

Alexander86

New Member
Oct 25, 2018
16
0
1
33
Hi, I have a template on which cloud init is installed, I do fullclone from it and after that I change the ip and gw parameters.
Option 1 - qm set 123 --ipconfig0 ip = 10.0.10.123 / 24, gw = 10.0.10.1
Option 2 Post request / nodes /% s /% s /% d / config in the body of which new parameters ip, gw are transmitted.
In ui Proxmox, the new parameters change, in the virtual machine configuration in the vmid.conf file, the parameters change to new , in the qocow2 file are changed to new parameters, but in the file etc / sysconfig / network-scripts / ifcfg-eth0 the parameters are not written. Tell me how to solve the problem thanks?
upload_2018-11-6_14-42-58.png
 
Last edited:

mira

Proxmox Staff Member
Staff member
Aug 1, 2018
449
39
28
Can you provide your VM config? (The ouput of qm config 123)
 

Alexander86

New Member
Oct 25, 2018
16
0
1
33
Can you provide your VM config? (The ouput of qm config 123)
boot: dcn
bootdisk: scsi0
citype: configdrive2
cores: 2
ide2: local:105/vm-105-cloudinit.qcow2,media=cdrom,size=5M
ipconfig0: ip=192.168.236.109/22,gw=192.168.238.2
localtime: 1
memory: 6144
name: 23674--current
net0: virtio=E6:E7:A9:85:6B:7E,bridge=vmbr0
numa: 1
ostype: l26
scsi0: vm-zvol-4:vm-105-disk-1,discard=on,iothread=1,size=60G
scsihw: virtio-scsi-single
smbios1: uuid=3e587edc-2c0f-487c-b669-27ebe9928c14
sockets: 2
vga: qxl
 

Alexander86

New Member
Oct 25, 2018
16
0
1
33
this is template params :
boot: dcn
bootdisk: scsi0
cores: 2
ide2: local:23674/vm-23674-cloudinit.qcow2,media=cdrom
ipconfig0: ip=192.168.236.74/22,gw=192.168.238.1
localtime: 1
memory: 6144
name: Sniffer-Alexander
net0: virtio=F2:A8:44:E3:7D:76,bridge=vmbr0
numa: 1
ostype: l26
parent: clean-7-0-10
protection: 1
scsi0: vm-zvol-4:base-23674-disk-1,discard=on,iothread=1,size=60G
scsihw: virtio-scsi-single
smbios1: uuid=95568f8d-1e27-424f-b644-da8f5e416255
sockets: 2
template: 1
vga: qxl
 

mira

Proxmox Staff Member
Staff member
Aug 1, 2018
449
39
28
Which distribution are you using? And which version of cloud-init do you use?
 

Alexander86

New Member
Oct 25, 2018
16
0
1
33
Which distribution are you using? And which version of cloud-init do you use?
HI, use centos 7 and cloud-init 0.7.9.

I opened the logs and the stages.py error appeared in them, in more detail in the screenshot. When I start the machine after executing the
"pvesh set /nodes/237-197/qemu/110/config --ipconfig1 ip=192.168.236.109/22,gw=192.168.236.132"
request, next to the main settings of the network ens18, a file with eth0 starts appears, if I change the name of the file ens18 to eth0 (as well as the settings inside the file to eth0), then the system does not update the information in it.
upload_2018-11-7_14-33-59.png
 

mira

Proxmox Staff Member
Staff member
Aug 1, 2018
449
39
28
Your cloud-init version might be too old, can you try using a newer package? (17.x or if possible a 18.x version)
 

Alexander86

New Member
Oct 25, 2018
16
0
1
33
Your cloud-init version might be too old, can you try using a newer package? (17.x or if possible a 18.x version)
View attachment 8626

When cloud-init makes changes in the network configuration file, it is written in IPPADDR = 0.0.0.0 /00 format, but it must write the ip address and prefix separately. Is this kind of problem you encountered? Naturally, the network does not work when everything in the file is written in one line.
 

Attachments

mira

Proxmox Staff Member
Staff member
Aug 1, 2018
449
39
28
Your cloud-init version is simply too old, it doesn't conform to the network configuration defined by cloud-init. Either update cloud-init, choose a different distribution with a newer cloud-init version (Fedora 28 for example, or 29) or choose a different method to configure your network.
 

Alexander86

New Member
Oct 25, 2018
16
0
1
33
Your cloud-init version is simply too old, it doesn't conform to the network configuration defined by cloud-init. Either update cloud-init, choose a different distribution with a newer cloud-init version (Fedora 28 for example, or 29) or choose a different method to configure your network.
I give up, the fact is that I can use centos 7 for work, and in yum it puts only 0.7.9 version, how to build and install a package with version 18 under centos 7 I don’t know yet if you have any hint I will be very grateful to you
 

Alexander86

New Member
Oct 25, 2018
16
0
1
33
Hello again, when installing cloud-init, a dependency error occurs. The machine installed Python 2.7 as well as versions 3.4 and 3.6, all of these versions have been downloaded via pip install necessary dependencies. They are located in the /usr/lib/python ... folder. But the error still repeats.


[root@localhost site-packages]# pip3 install six
Collecting six
Using cached https://files.pythonhosted.org/pack...863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Installing collected packages: six
Successfully installed six-1.11.0

[root@localhost site-packages]# rpm -i /Developing/cloud-init-17.1-7.fc29.noarch.rpm
error: Failed dependencies:
libselinux-python3 is needed by cloud-init-17.1-7.fc29.noarch
policycoreutils-python3 is needed by cloud-init-17.1-7.fc29.noarch
python(abi) = 3.7 is needed by cloud-init-17.1-7.fc29.noarch
python3-PyYAML is needed by cloud-init-17.1-7.fc29.noarch
/..................................................................................................../
python3-six is needed by cloud-init-17.1-7.fc29.noarch

[root@localhost site-packages]#
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE and Proxmox Mail Gateway. We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!