Hi All!

I'm trying to configure network in VMs created from template, and see strange behaviour from cloud-init.
cloud-init installed and enabled in template.
ver cloud-init-0.7.9-24.el7.centos.1.x86_64
guest Centos 7.5
ovirt 4.2.7 from ovirt-releases-42-pre repo

1. I use "run once" with initial run - use cloud-init - networks
 in-guest net iface : eth0
add new - static
enter address, mask, gw
ipv6 none

Run (once) and cloud-init configure ifcfg-eth0 for that address (successfully).

2. I shutdown that VM and use "Run" (regular) without "use cloud init" in VM properties, awaiting that above configurations are saved (and booted with it).

But because "use cloud init" not checked, and cloud-init service enabled, it start, cannot find datasource and drop configuration to default (dhcp).

In cloud-init.log

2018-11-20 13:53:24,153 - util.py[WARNING]: No instance datasource found! Likely bad things to come! 2018-11-20 13:53:24,153 - util.py[DEBUG]: No instance datasource found! Likely bad things to come!
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/cloudinit/cmd/main.py", line 236, in main_init
    init.fetch(existing=existing)
File "/usr/lib/python2.7/site-packages/cloudinit/stages.py", line 343, in fetch
    return self._get_data_source(existing=existing)
File "/usr/lib/python2.7/site-packages/cloudinit/stages.py", line 253, in _get_data_source
    pkg_list, self.reporter)
File "/usr/lib/python2.7/site-packages/cloudinit/sources/__init__.py", line 320, in find_source
    raise DataSourceNotFoundException(msg)
DataSourceNotFoundException: Did not find any data source, searched classes: (DataSourceNoCloudNet) 2018-11-20 13:53:24,194 - stages.py[DEBUG]: applying net config names for {'version': 1, 'config': [{'subnets': [{'type': 'dhcp'}],
'type': 'physical', 'name': 'eth0', 'mac_address': '56:6f:21:4a:00:04'}]}

It reverts config as in here
https://lists.ovirt.org/archives/list/users@ovirt.org/thread/NE27UO4WNZIC27GZY4D2DCFX4DIYFBQP/

3. then I found bug
https://bugzilla.redhat.com/show_bug.cgi?id=1439373#c5

and when "run once" I disable network config as in that comment.
Shutdown, Run (not once) and voila! Ip address are static!

2018-11-20 15:07:31,601 - handlers.py[DEBUG]: finish: init-network/search-NoCloudNet: SUCCESS: no network data found from DataSource NoCloudNet
.....
2018-11-20 15:07:31,602 - util.py[WARNING]: No instance datasource found! Likely bad things to come! 2018-11-20 15:07:31,602 - util.py[DEBUG]: No instance datasource found! Likely bad things to come!

2018-11-20 15:07:31,639 - stages.py[DEBUG]: network config disabled by system_cfg 2018-11-20 15:07:31,639 - stages.py[INFO]: network config is disabled by system_cfg 2018-11-20 15:07:31,639 - main.py[DEBUG]: [net] Exiting without datasource in local mode 2018-11-20 15:07:31,640 - util.py[DEBUG]: Reading from /proc/uptime (quiet=False)
2018-11-20 15:07:31,640 - util.py[DEBUG]: Read 12 bytes from /proc/uptime
2018-11-20 15:07:31,640 - util.py[DEBUG]: cloud-init mode 'init' took 0.287 seconds (0.29) 2018-11-20 15:07:31,640 - handlers.py[DEBUG]: finish: init-network: SUCCESS: searching for network datasources

"cloud-init used to use a "marker" file that it created on initial execution. If that "marker" file existed it would not rerun on reboot. " - are it not working in ovirt/this cloud-init version ?

--
Mike
_______________________________________________
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@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/SNJ6IAZ2C6VJR6IAVZHTL6LM5DIWSXJR/

Reply via email to