Hi,
we made this solution for us:
We add a cloud-init script to the cloud image, before we add this to our templates.
In /etc/cloud/cloud.cfg.d/, we create a file 98_runcmd.cfg with the following content:
write_files:
- content: |
network: {config: disabled}
path: /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
permissions: '0700'
- content: |
#!/bin/bash
rm /etc/cloud/cloud.cfg.d/90_dpkg.cfg
path: /var/lib/cloud/scripts/per-boot/datasources.sh
permissions: '0700'
This should create the file /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg after first cloud-init run and then network config is never touched again.
Without disabling cloud-init completely, you are able for example to set a root password to login into VM console, when you have to debug something and can't login anymore to ssh.
We have password logins disabled by default over ssh.
We also remove /etc/cloud/cloud.cfg.d/90_dpkg.cfg and set datasource_list to ["NoCloud", "ConfigDrive"] in /etc/cloud/cloud.cfg
-> VM will reboot with this a way faster. Without it, cloud-init will look for too much different location to find a valid config.
LG Florian
Von: "Eitan Raviv" <eraviv@redhat.com>
An: "Ryan McCabe" <rmccabe@redhat.com>
CC: "users" <users@ovirt.org>, "geoff carr" <geoff.carr@beazley.com>
Gesendet: Mittwoch, 20. Juni 2018 08:20:54
Betreff: [ovirt-users] Re: cloud-init reverting static network settings to DHCP on shutdown and restart
Hi Ryan,
This behaviour reproduces for me as well with
ovirt-engine-latest-nightly-snapshot,
cloud-init-0.7.9-24.el7.x86_64,
Centos-7.4.1708 VM.
Can you comment?
Thanks
_______________________________________________
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-leave@ovirt.org
Privacy Statement: https://www.ovirt.org/site/privacy-policy/
oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/
List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/IKYRL5TVH3JTFS2AIXAACJZD7VUWAEMZ/