<div dir="ltr">Still no change...<div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><br></div></blockquote></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div> myoung  dev    ~  repos  github  vagrant-ovirt4  feature/gh65  ✎  $  vagrant up</div></div><div><div>You appear to be running Vagrant outside of the official installers.</div></div><div><div>Note that the installers are what ensure that Vagrant has all required</div></div><div><div>dependencies, and Vagrant assumes that these dependencies exist. By</div></div><div><div>running outside of the installer environment, Vagrant may not function</div></div><div><div>properly. To remove this warning, install Vagrant using one of the</div></div><div><div>official packages from <a href="http://vagrantup.com">vagrantup.com</a>.</div></div><div><div><br></div></div><div><div>Bringing machine &#39;default&#39; up with &#39;ovirt4&#39; provider...</div></div><div><div>==&gt; default: Creating VM with the following settings...</div></div><div><div>==&gt; default:  -- Name:          testing</div></div><div><div>==&gt; default:  -- Cluster:       Default</div></div><div><div>==&gt; default:  -- Template:      vagrant-centos7</div></div><div><div>==&gt; default:  -- Console Type:  vnc</div></div><div><div>==&gt; default:  -- Memory:</div></div><div><div>==&gt; default:  ---- Memory:      2048 MB</div></div><div><div>==&gt; default:  ---- Maximum:     2048 MB</div></div><div><div>==&gt; default:  ---- Guaranteed:  2048 MB</div></div><div><div>==&gt; default:  -- Cpu:</div></div><div><div>==&gt; default:  ---- Cores:       2</div></div><div><div>==&gt; default:  ---- Sockets:     1</div></div><div><div>==&gt; default:  ---- Threads:     1</div></div><div><div>==&gt; default:  -- Cloud-Init:    false</div></div><div><div>==&gt; default: Waiting for VM to become &quot;ready&quot; to start...</div></div><div><div>==&gt; default: Starting VM.</div></div><div><div><br></div></div><div><div>From: /home/myoung/repos/github/vagrant-ovirt4/lib/vagrant-ovirt4/action/start_vm.rb @ line 79 VagrantPlugins::OVirtProvider::Action::StartVM#call:</div></div><div><div><br></div></div><div><div>    74:           vm_configuration[:initialization][:dns_search] = iface_options[:dns_search] unless iface_options[:dns_search].nil?</div></div><div><div>    75:</div></div><div><div>    76:           require &#39;pry&#39;</div></div><div><div>    77:           binding.pry</div></div><div><div>    78:</div></div><div><div> =&gt; 79:           machine.start(</div></div><div><div>    80:             use_cloud_init: true,</div></div><div><div>    81:             vm: vm_configuration</div></div><div><div>    82:           )</div></div><div><div>    83:</div></div><div><div>    84:           @app.call(env)</div></div><div><div><br></div></div><div><div>[1] pry(#&lt;VagrantPlugins::OVirtProvider::Action::StartVM&gt;)&gt; vm_configuration</div></div><div><div>=&gt; {:initialization=&gt;</div></div><div><div>  {:host_name=&gt;&quot;testing&quot;,</div></div><div><div>   :nic_configurations=&gt;[{:name=&gt;&quot;eth0&quot;, :on_boot=&gt;true, :boot_protocol=&gt;&quot;static&quot;, :ip=&gt;{:version=&gt;&quot;v4&quot;, :address=&gt;&quot;192.168.2.120&quot;, :gateway=&gt;&quot;192.168.2.1&quot;, :netmask=&gt;&quot;255.255.255.0&quot;}}],</div></div><div><div>   :custom_script=&gt;nil,</div></div><div><div>   :dns_servers=&gt;&quot;192.168.2.1&quot;,</div></div><div><div>   :dns_search=&gt;&quot;test.local&quot;}}</div></div><div><div>[2] pry(#&lt;VagrantPlugins::OVirtProvider::Action::StartVM&gt;)&gt;</div></div><div><div>==&gt; default: Waiting for VM to get an IP address...</div></div><div><div>==&gt; default: Machine is booted and ready for use!</div></div><div><div>==&gt; default: Rsyncing folder: /home/myoung/repos/github/vagrant-ovirt4/ =&gt; /vagrant</div></div><div><div>==&gt; default: Setting hostname...</div></div><div><div>    default:</div></div><div><div>    default: Vagrant insecure key detected. Vagrant will automatically replace</div></div><div><div>    default: this with a newly generated keypair for better security.</div></div><div><div>    default:</div></div><div><div>    default: Inserting generated public key within guest...</div></div><div><div>    default: Removing insecure key from the guest if it&#39;s present...</div></div><div><div>    default: Key inserted! Disconnecting and reconnecting using new SSH key...</div></div><div><div> myoung  dev    ~  repos  github  vagrant-ovirt4  feature/gh65  ✎  $  vagrant ssh</div></div><div><div>You appear to be running Vagrant outside of the official installers.</div></div><div><div>Note that the installers are what ensure that Vagrant has all required</div></div><div><div>dependencies, and Vagrant assumes that these dependencies exist. By</div></div><div><div>running outside of the installer environment, Vagrant may not function</div></div><div><div>properly. To remove this warning, install Vagrant using one of the</div></div><div><div>official packages from <a href="http://vagrantup.com">vagrantup.com</a>.</div></div><div><div><br></div></div><div><div>Last login: Wed Feb 15 00:23:35 2017 from 192.168.2.32</div></div><div><div>[vagrant@testing ~]$ cat /etc/resolv.conf</div></div><div><div># Generated by NetworkManager</div></div><div><div>search localdomain</div></div><div><div>[vagrant@testing ~]$ cat /etc/sysconfig/network-scripts/ifcfg-eth0</div></div><div><div>NM_CONTROLLED=no</div></div><div><div>NETMASK=255.255.255.0</div></div><div><div>BOOTPROTO=static</div></div><div><div>DEVICE=eth0</div></div><div><div>IPADDR=192.168.2.120</div></div><div><div>GATEWAY=192.168.2.1</div></div><div><div>ONBOOT=yes</div></div></blockquote><div><div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><br></div></blockquote>If i check out the floppy attached to that VM:</div><div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div>[myoung@ovirt ~]$ sudo ps -ef | grep qemu-kvm | grep test</div></div><div><div>[sudo] password for myoung:</div></div><div><div>qemu     24311     1 87 01:38 ?        00:00:18 .....</div></div><div><div>[myoung@ovirt ~]$ sudo cp /var/run/vdsm/payload/9964609e-8d85-4a5c-9416-8e11b2fd5883.d0d0739973bfb4b6eb67d1f4974c3e0c.img .</div></div><div><div>[myoung@ovirt ~]$ mkdir a; sudo mount -o loop,ro 9964609e-8d85-4a5c-9416-8e11b2fd5883.d0d0739973bfb4b6eb67d1f4974c3e0c.img a</div></div><div><div>[myoung@ovirt ~]$ sudo cat $(sudo find a -name 0000 -type f)</div></div><div><div>auto eth0</div></div><div><div>iface eth0 inet static</div></div><div><div>  address 192.168.2.120</div></div><div><div>  netmask 255.255.255.0</div></div><div><div>  gateway 192.168.2.1</div></div><div><div>  dns-nameservers 192.168.2.1</div></div><div><div>  dns-search test.local</div></div><div><div>[myoung@ovirt ~]$ sudo umount a</div></div></blockquote><div><br></div><div><br></div><div>What&#39;s the next step? Is there a way to verify on the upstream that dns-search and dns-nameservers actually populate the ifcfg-eth0 file ?</div><div><br></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Feb 18, 2017 at 6:58 AM, Juan Hernández <span dir="ltr">&lt;<a href="mailto:jhernand@redhat.com" target="_blank">jhernand@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail-m_5845533094908090176HOEnZb"><div class="gmail-m_5845533094908090176h5">On 02/17/2017 08:11 PM, Marc Young wrote:<br>
&gt; Per the script, i&#39;ll change that, probably just wasnt paying attention<br>
&gt; to where i ran chkconfig<br>
&gt;<br>
&gt; Per cloud-init YAML, not sure. It was in a previous reply so i gave it a<br>
&gt; shot. But i can&#39;t find that usage anywhere either so i gave up on it.<br>
&gt;<br>
&gt; Per troubleshooting:<br>
&gt;<br>
&gt; Spinning up a VM with dns_servers and dns_search:<br>
&gt;<br>
&gt;         66:           vm_configuration[:initializat<wbr>ion][:dns_servers] =<br>
&gt;     iface_options[:dns_servers] unless iface_options[:dns_servers].ni<wbr>l?<br>
&gt;         67:           vm_configuration[:initializat<wbr>ion][:dns_search] =<br>
&gt;     iface_options[:dns_search] unless iface_options[:dns_search].nil<wbr>?<br>
&gt;         68:           require &#39;pry&#39;<br>
&gt;         69:           binding.pry<br>
&gt;         70:<br>
&gt;      =&gt; 71:           machine.start(<br>
&gt;         72:             use_cloud_init: true,<br>
&gt;         73:             vm: vm_configuration<br>
&gt;         74:           )<br>
&gt;         75:<br>
&gt;         76:           @app.call(env)<br>
&gt;<br>
&gt;     [1] pry(#&lt;VagrantPlugins::OVirtPro<wbr>vider::Action::StartVM&gt;)&gt;<br>
&gt;     vm_configuration<br>
&gt;     =&gt; {:initialization=&gt;<br>
&gt;       {:host_name=&gt;&quot;test&quot;,<br>
&gt;        :nic_configurations=&gt;[{:name=&gt;<wbr>&quot;eth0&quot;, :on_boot=&gt;true,<br>
&gt;     :boot_protocol=&gt;&quot;static&quot;, :ip=&gt;{:version=&gt;&quot;v4&quot;,<br>
&gt;     :address=&gt;&quot;192.168.2.200&quot;, :gateway=&gt;&quot;192.168.2.1&quot;,<br>
&gt;     :netmask=&gt;&quot;255.255.255.0&quot;}}],<br>
&gt;        :custom_script=&gt;<br>
&gt;         &quot;manage-resolv-conf: true\n\nresolv_conf:\n  nameservers:<br>
&gt;     [&#39;8.8.4.4&#39;, &#39;8.8.8.8&#39;]\n  searchdomains:\n    - <a href="http://foo.example.com" rel="noreferrer" target="_blank">foo.example.com</a><br>
</div></div>&gt;     &lt;<a href="http://foo.example.com" rel="noreferrer" target="_blank">http://foo.example.com</a>&gt;\n    - <a href="http://bar.example.com" rel="noreferrer" target="_blank">bar.example.com</a><br>
&gt;     &lt;<a href="http://bar.example.com" rel="noreferrer" target="_blank">http://bar.example.com</a>&gt;\n  domain: <a href="http://example.com" rel="noreferrer" target="_blank">example.com</a><br>
&gt;     &lt;<a href="http://example.com" rel="noreferrer" target="_blank">http://example.com</a>&gt;\n  options:\n    rotate: true\n    timeout: 1\n&quot;,<br>
<div><div class="gmail-m_5845533094908090176h5">&gt;        :dns_servers=&gt;&quot;192.168.2.1&quot;,<br>
&gt;        :dns_search=&gt;&quot;test.local&quot;}}<br>
&gt;     [2] pry(#&lt;VagrantPlugins::OVirtPro<wbr>vider::Action::StartVM&gt;)&gt;<br>
&gt;     ==&gt; default: Waiting for VM to get an IP address...<br>
&gt;     ==&gt; default: Machine is booted and ready for use!<br>
&gt;     ==&gt; default: Rsyncing folder:<br>
&gt;     /home/myoung/repos/github/vag<wbr>rant-ovirt4/ =&gt; /vagrant<br>
&gt;     ==&gt; default: Setting hostname...<br>
&gt;         default:<br>
&gt;         default: Vagrant insecure key detected. Vagrant will<br>
&gt;     automatically replace<br>
&gt;         default: this with a newly generated keypair for better security.<br>
&gt;         default:<br>
&gt;         default: Inserting generated public key within guest...<br>
&gt;         default: Removing insecure key from the guest if it&#39;s present...<br>
&gt;         default: Key inserted! Disconnecting and reconnecting using new<br>
&gt;     SSH key...<br>
&gt;<br>
&gt;<br>
&gt; now ill ssh in and look around<br>
&gt;<br>
&gt;      myoung  dev    ~  repos  github  vagrant-ovirt4 <br>
&gt;     feature/gh65  ✎  5❓  1  $  vagrant ssh<br>
&gt;     You appear to be running Vagrant outside of the official installers.<br>
&gt;     Note that the installers are what ensure that Vagrant has all required<br>
&gt;     dependencies, and Vagrant assumes that these dependencies exist. By<br>
&gt;     running outside of the installer environment, Vagrant may not function<br>
&gt;     properly. To remove this warning, install Vagrant using one of the<br>
</div></div>&gt;     official packages from <a href="http://vagrantup.com" rel="noreferrer" target="_blank">vagrantup.com</a> &lt;<a href="http://vagrantup.com" rel="noreferrer" target="_blank">http://vagrantup.com</a>&gt;.<br>
<span>&gt;<br>
&gt;     Last login: Thu Feb 16 23:04:00 2017 from 192.168.2.198<br>
&gt;     [vagrant@test ~]$ sudo cat /var/lib/cloud/instance/user-d<wbr>ata.txt<br>
&gt;     #cloud-config<br>
&gt;     output:<br>
&gt;       all: &#39;&gt;&gt; /var/log/cloud-init-output.log<wbr>&#39;<br>
&gt;     disable_root: 0<br>
&gt;     runcmd:<br>
&gt;     - &#39;sed -i &#39;&#39;/^datasource_list: /d&#39;&#39; /etc/cloud/cloud.cfg; echo<br>
&gt;     &#39;&#39;datasource_list:<br>
&gt;       [&quot;NoCloud&quot;, &quot;ConfigDrive&quot;]&#39;&#39; &gt;&gt; /etc/cloud/cloud.cfg&#39;<br>
&gt;     ssh_pwauth: true<br>
&gt;     chpasswd:<br>
&gt;       expire: false<br>
&gt;     user: root<br>
&gt;     manage-resolv-conf: true<br>
&gt;<br>
&gt;     resolv_conf:<br>
&gt;       nameservers: [&#39;8.8.4.4&#39;, &#39;8.8.8.8&#39;]<br>
&gt;       searchdomains:<br>
</span>&gt;         - <a href="http://foo.example.com" rel="noreferrer" target="_blank">foo.example.com</a> &lt;<a href="http://foo.example.com" rel="noreferrer" target="_blank">http://foo.example.com</a>&gt;<br>
&gt;         - <a href="http://bar.example.com" rel="noreferrer" target="_blank">bar.example.com</a> &lt;<a href="http://bar.example.com" rel="noreferrer" target="_blank">http://bar.example.com</a>&gt;<br>
&gt;       domain: <a href="http://example.com" rel="noreferrer" target="_blank">example.com</a> &lt;<a href="http://example.com" rel="noreferrer" target="_blank">http://example.com</a>&gt;<br>
<span>&gt;       options:<br>
&gt;         rotate: true<br>
&gt;         timeout: 1<br>
<br>
</span>Apparently you are passing in the &#39;custom_script&#39; some DNS<br>
configuration, which may conflict with the DNS configuration that you<br>
are passing in the &#39;dns_servers&#39; and &#39;dns_search&#39; options. It could be<br>
that cloud-init ignores one of them. I&#39;d suggest that you try to remove<br>
completely the &#39;custom_script&#39; parameter.<br>
<div><div class="gmail-m_5845533094908090176h5"><br>
&gt;     [vagrant@test ~]$ sudo cat /etc/resolv.conf<br>
&gt;     # Generated by NetworkManager<br>
&gt;     search localdomain<br>
&gt;<br>
&gt;     [vagrant@test ~]$ cat /etc/sysconfig/network-scripts<wbr>/ifcfg-eth0<br>
&gt;     NM_CONTROLLED=no<br>
&gt;     NETMASK=255.255.255.0<br>
&gt;     BOOTPROTO=static<br>
&gt;     DEVICE=eth0<br>
&gt;     IPADDR=192.168.2.200<br>
&gt;     GATEWAY=192.168.2.1<br>
&gt;     ONBOOT=yes<br>
&gt;<br>
&gt;     [vagrant@test ~]$ sudo cat /var/log/cloud-init* | grep -i dns<br>
&gt;     [vagrant@test ~]$ sudo cat /var/log/cloud-init* | grep -i local<br>
&gt;     Feb 14 23:16:45 vagrant cloud-init: Cloud-init v. 0.7.5 running<br>
&gt;     &#39;init-local&#39; at Wed, 15 Feb 2017 05:16:45 +0000. Up 11.00 seconds.<br>
&gt;     Feb 16 23:03:35 test cloud-init: Cloud-init v. 0.7.5 running<br>
&gt;     &#39;init-local&#39; at Fri, 17 Feb 2017 05:03:35 +0000. Up 5.23 seconds.<br>
&gt;     Cloud-init v. 0.7.5 running &#39;init-local&#39; at Thu, 09 Feb 2017<br>
&gt;     03:45:01 +0000. Up 1310.61 seconds.<br>
&gt;     Cloud-init v. 0.7.5 running &#39;init-local&#39; at Wed, 15 Feb 2017<br>
&gt;     05:16:45 +0000. Up 11.00 seconds.<br>
&gt;     Cloud-init v. 0.7.5 running &#39;init-local&#39; at Fri, 17 Feb 2017<br>
&gt;     05:03:35 +0000. Up 5.23 seconds.<br>
&gt;     Cloud-init v. 0.7.5 finished at Fri, 17 Feb 2017 05:03:45 +0000.<br>
&gt;     Datasource DataSourceConfigDrive [local,ver=2][source=/dev/sr1]<wbr>.  Up<br>
&gt;     15.37 seconds<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On the vm host running that VM:<br>
&gt;<br>
&gt;<br>
&gt;     [myoung@ovirt ~]$ sudo ps -ef | grep qemu-kvm | grep test<br>
&gt;     qemu     12456     1  9 05:03 ?        00:00:19<br>
&gt;     /usr/libexec/qemu-kvm -name ...snipped<br>
&gt;     [myoung@ovirt ~]$ sudo cp<br>
&gt;     /var/run/vdsm/payload/c65751c<wbr>3-431d-44e4-836c-963b81b1f846.<wbr>20fc2db0517e8c06579d7719d8f3fb<wbr>35.img<br>
&gt;     .<br>
&gt;     [myoung@ovirt ~]$ sudo mount -o loop,ro<br>
&gt;     c65751c3-431d-44e4-836c-963b8<wbr>1b1f846.20fc2db0517e8c06579d77<wbr>19d8f3fb35.img<br>
&gt;     /mnt<br>
&gt;     [myoung@ovirt ~]$ find /mnt -type f<br>
&gt;     find: ‘/mnt’: Permission denied<br>
&gt;     [myoung@ovirt ~]$ sudo find /mnt -type f<br>
&gt;     /mnt/openstack/content/0000<br>
&gt;     /mnt/openstack/latest/meta_da<wbr>ta.json<br>
&gt;     /mnt/openstack/latest/user_da<wbr>ta<br>
&gt;     [myoung@ovirt ~]$ sudo cat /mnt/openstack/content/0000<br>
&gt;     auto eth0<br>
&gt;     iface eth0 inet static<br>
&gt;       address 192.168.2.200<br>
&gt;       netmask 255.255.255.0<br>
&gt;       gateway 192.168.2.1<br>
&gt;       dns-nameservers 192.168.2.1<br>
&gt;       dns-search test.local<br>
&gt;     [myoung@ovirt ~]$ sudo umount<br>
&gt;     c65751c3-431d-44e4-836c-963b8<wbr>1b1f846.20fc2db0517e8c06579d77<wbr>19d8f3fb35.img<br>
&gt;<br>
&gt; Cloud-init definitely isn&#39;t working right away with resolv.conf, but I&#39;m<br>
&gt; definitely passing it correctly to the API, it shows up on the floppy as<br>
&gt; you described but it&#39;s not making its way to<br>
&gt; /etc/sysconfig/network-scripts<wbr>/ifcfg-eth0 even though the other settings<br>
&gt; for sure are (such as address, netmask,)<br>
&gt;<br>
&gt; If i add that information to /etc/sysconfig/network-scripts<wbr>/ifcfg-eth0<br>
&gt; and bounce network it all works:<br>
&gt;<br>
</div></div>&gt;     [vagrant@test ~]$ ping -c 3 <a href="http://www.google.com" rel="noreferrer" target="_blank">www.google.com</a> &lt;<a href="http://www.google.com" rel="noreferrer" target="_blank">http://www.google.com</a>&gt;<br>
&gt;     ping: <a href="http://www.google.com" rel="noreferrer" target="_blank">www.google.com</a> &lt;<a href="http://www.google.com" rel="noreferrer" target="_blank">http://www.google.com</a>&gt;: Name or service not known<br>
<span>&gt;     [vagrant@test ~]$ echo $&#39;DNS1=192.168.2.113\nDNS2=192<wbr>.168.2.1&#39; |<br>
&gt;     sudo tee -a /etc/sysconfig/network-scripts<wbr>/ifcfg-eth0 &gt;/dev/null<br>
</span>&gt;     [vagrant@test ~]$ ping -c 3 <a href="http://www.google.com" rel="noreferrer" target="_blank">www.google.com</a> &lt;<a href="http://www.google.com" rel="noreferrer" target="_blank">http://www.google.com</a>&gt;<br>
&gt;     ping: <a href="http://www.google.com" rel="noreferrer" target="_blank">www.google.com</a> &lt;<a href="http://www.google.com" rel="noreferrer" target="_blank">http://www.google.com</a>&gt;: Name or service not known<br>
<span>&gt;     [vagrant@test ~]$ sudo service network restart<br>
&gt;     Restarting network (via systemctl):                        [  OK  ]<br>
</span>&gt;     [vagrant@test ~]$ ping -c 3 <a href="http://www.google.com" rel="noreferrer" target="_blank">www.google.com</a> &lt;<a href="http://www.google.com" rel="noreferrer" target="_blank">http://www.google.com</a>&gt;<br>
&gt;     PING <a href="http://www.google.com" rel="noreferrer" target="_blank">www.google.com</a> &lt;<a href="http://www.google.com" rel="noreferrer" target="_blank">http://www.google.com</a>&gt; (216.58.217.4) 56(84)<br>
<span>&gt;     bytes of data.<br>
&gt;     64 bytes from <a href="http://den03s09-in-f4.1e100.net" rel="noreferrer" target="_blank">den03s09-in-f4.1e100.net</a><br>
</span>&gt;     &lt;<a href="http://den03s09-in-f4.1e100.net" rel="noreferrer" target="_blank">http://den03s09-in-f4.1e100.<wbr>net</a>&gt; (216.58.217.4): icmp_seq=1 ttl=54<br>
<span>&gt;     time=55.8 ms<br>
&gt;     64 bytes from <a href="http://den03s09-in-f4.1e100.net" rel="noreferrer" target="_blank">den03s09-in-f4.1e100.net</a><br>
</span>&gt;     &lt;<a href="http://den03s09-in-f4.1e100.net" rel="noreferrer" target="_blank">http://den03s09-in-f4.1e100.<wbr>net</a>&gt; (216.58.217.4): icmp_seq=2 ttl=54<br>
&gt;     time=43.9 ms<br>
&gt;     ^C<br>
&gt;     --- <a href="http://www.google.com" rel="noreferrer" target="_blank">www.google.com</a> &lt;<a href="http://www.google.com" rel="noreferrer" target="_blank">http://www.google.com</a>&gt; ping statistics ---<br>
<span>&gt;     2 packets transmitted, 2 received, 0% packet loss, time 1001ms<br>
&gt;     rtt min/avg/max/mdev = 43.939/49.916/55.894/5.981 ms<br>
&gt;     [vagrant@test ~]$ sudo cat /etc/resolv.conf<br>
&gt;     # Generated by NetworkManager<br>
&gt;     search localdomain<br>
&gt;     nameserver 192.168.2.113<br>
&gt;     nameserver 192.168.2.1<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Fri, Feb 17, 2017 at 2:21 AM, Juan Hernández &lt;<a href="mailto:jhernand@redhat.com" target="_blank">jhernand@redhat.com</a><br>
</span><span>&gt; &lt;mailto:<a href="mailto:jhernand@redhat.com" target="_blank">jhernand@redhat.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     On 02/17/2017 06:00 AM, Marc Young wrote:<br>
&gt;     &gt; I&#39;m apparently really bad at email, I replied only to Shahar, not the<br>
&gt;     &gt; whole thread.<br>
&gt;     &gt;<br>
&gt;     &gt; Vinzenz your email slipped first, so to answer your question:<br>
&gt;     &gt;<br>
&gt;     &gt; It&#39;s the latest Centos 7 with these installed:<br>
&gt;     &gt;<br>
&gt;     &gt; cloud-init-0.7.5-10.el7.centos<wbr>.1<br>
</span>&gt;     &gt; kernel-<a href="tel:3.10.0-514" value="+13100514" target="_blank">3.10.0-514</a> &lt;tel:<a href="tel:3.10.0-514" value="+13100514" target="_blank">3.10.0-514</a>&gt; &lt;tel:<a href="tel:3.10.0-514" value="+13100514" target="_blank">3.10.0-514</a><br>
<div><div class="gmail-m_5845533094908090176h5">&gt;     &lt;tel:<a href="tel:3.10.0-514" value="+13100514" target="_blank">3.10.0-514</a>&gt;&gt;.el7<br>
&gt;     &gt; ovirt-guest-agent-common-1.0.1<wbr>3-1.20161220085008.git165fff1.<wbr>el7.centos<br>
&gt;     &gt;<br>
&gt;     &gt; The setup script I use to create a template is here:<br>
&gt;     &gt; <a href="https://github.com/myoung34/vagrant-ovirt4/blob/master/tools/prepare_redhat_for_box.sh" rel="noreferrer" target="_blank">https://github.com/myoung34/va<wbr>grant-ovirt4/blob/master/tools<wbr>/prepare_redhat_for_box.sh</a><br>
&gt;     &lt;<a href="https://github.com/myoung34/vagrant-ovirt4/blob/master/tools/prepare_redhat_for_box.sh" rel="noreferrer" target="_blank">https://github.com/myoung34/<wbr>vagrant-ovirt4/blob/master/too<wbr>ls/prepare_redhat_for_box.sh</a>&gt;<br>
&gt;     &gt;<br>
&gt;     &lt;<a href="https://github.com/myoung34/vagrant-ovirt4/blob/master/tools/prepare_redhat_for_box.sh" rel="noreferrer" target="_blank">https://github.com/myoung34/<wbr>vagrant-ovirt4/blob/master/too<wbr>ls/prepare_redhat_for_box.sh</a><br>
&gt;     &lt;<a href="https://github.com/myoung34/vagrant-ovirt4/blob/master/tools/prepare_redhat_for_box.sh" rel="noreferrer" target="_blank">https://github.com/myoung34/<wbr>vagrant-ovirt4/blob/master/too<wbr>ls/prepare_redhat_for_box.sh</a>&gt;&gt;<br>
&gt;     &gt;<br>
&gt;<br>
&gt;     In that script you run &quot;chkconfig cloud-init on&quot; *before* installing the<br>
&gt;     cloud-init package. That is irrelevant, as the cloud-init services are<br>
&gt;     enabled by default when the package is installed. But worth changing.<br>
&gt;<br>
&gt;     &gt; The engine-host is oVirt Engine Version: 4.1.0.4-1.el7.centos<br>
&gt;     &gt; The ruby SDK i&#39;m working with is 4.1.2<br>
&gt;     &gt;<br>
&gt;     &gt; Halfway through I realized that it&#39;s actually supported in the API:<br>
&gt;     &gt;<br>
&gt;     &gt;     custom_script String<br>
&gt;     &gt;     dns_search String<br>
&gt;     &gt;     dns_servers String<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt; It also shows usage here:<br>
&gt;     &gt;<br>
&gt;     <a href="https://github.com/oVirt/ovirt-engine-sdk-ruby/blob/master/sdk/examples/start_vm_with_cloud_init.rb" rel="noreferrer" target="_blank">https://github.com/oVirt/ovir<wbr>t-engine-sdk-ruby/blob/master/<wbr>sdk/examples/start_vm_with_<wbr>cloud_init.rb</a><br>
&gt;     &lt;<a href="https://github.com/oVirt/ovirt-engine-sdk-ruby/blob/master/sdk/examples/start_vm_with_cloud_init.rb" rel="noreferrer" target="_blank">https://github.com/oVirt/ovi<wbr>rt-engine-sdk-ruby/blob/master<wbr>/sdk/examples/start_vm_with_<wbr>cloud_init.rb</a>&gt;<br>
&gt;     &gt;<br>
&gt;     &lt;<a href="https://github.com/oVirt/ovirt-engine-sdk-ruby/blob/master/sdk/examples/start_vm_with_cloud_init.rb" rel="noreferrer" target="_blank">https://github.com/oVirt/ovi<wbr>rt-engine-sdk-ruby/blob/master<wbr>/sdk/examples/start_vm_with_<wbr>cloud_init.rb</a><br>
&gt;     &lt;<a href="https://github.com/oVirt/ovirt-engine-sdk-ruby/blob/master/sdk/examples/start_vm_with_cloud_init.rb" rel="noreferrer" target="_blank">https://github.com/oVirt/ovi<wbr>rt-engine-sdk-ruby/blob/master<wbr>/sdk/examples/start_vm_with_<wbr>cloud_init.rb</a>&gt;&gt;<br>
&gt;     &gt;<br>
&gt;     &gt; Here&#39;s some verification:<br>
&gt;     &gt;<br>
&gt;     &gt;         66:<br>
&gt;      vm_configuration[:initializati<wbr>on][:dns_servers] =<br>
&gt;     &gt;     iface_options[:dns_servers] unless<br>
&gt;     iface_options[:dns_servers].n<wbr>il?<br>
&gt;     &gt;         67:           vm_configuration[:initializat<wbr>ion][:dns_search] =<br>
&gt;     &gt;     iface_options[:dns_search] unless iface_options[:dns_search].nil<wbr>?<br>
&gt;     &gt;         68:           require &#39;pry&#39;<br>
&gt;     &gt;         69:           binding.pry<br>
&gt;     &gt;         70:<br>
&gt;     &gt;      =&gt; 71:           machine.start(<br>
&gt;     &gt;         72:             use_cloud_init: true,<br>
&gt;     &gt;         73:             vm: vm_configuration<br>
&gt;     &gt;         74:           )<br>
&gt;     &gt;         75:<br>
&gt;     &gt;         76:           @app.call(env)<br>
&gt;     &gt;<br>
&gt;     &gt;     [1] pry(#&lt;VagrantPlugins::OVirtPro<wbr>vider::Action::StartVM&gt;)&gt;<br>
&gt;     &gt;     vm_configuration<br>
&gt;     &gt;     =&gt; {:initialization=&gt;<br>
&gt;     &gt;       {:host_name=&gt;&quot;test&quot;,<br>
&gt;     &gt;        :nic_configurations=&gt;[{:name=&gt;<wbr>&quot;eth0&quot;, :on_boot=&gt;true,<br>
&gt;     &gt;     :boot_protocol=&gt;&quot;static&quot;, :ip=&gt;{:version=&gt;&quot;v4&quot;,<br>
&gt;     &gt;     :address=&gt;&quot;192.168.2.200&quot;, :gateway=&gt;&quot;192.168.2.1&quot;,<br>
&gt;     &gt;     :netmask=&gt;&quot;255.255.255.0&quot;}}],<br>
&gt;     &gt;        :custom_script=&gt;nil,<br>
&gt;     &gt;        :dns_servers=&gt;&quot;192.168.2.1&quot;,<br>
&gt;     &gt;        :dns_search=&gt;&quot;test.local&quot;}}<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt; But it didn&#39;t do anything:<br>
&gt;     &gt;<br>
&gt;     &gt;     [vagrant@test ~]$ cat /etc/resolv.conf<br>
&gt;     &gt;     # Generated by NetworkManager<br>
&gt;     &gt;     search localdomain<br>
&gt;     &gt;<br>
&gt;     &gt;     [vagrant@test ~]$ cat /etc/sysconfig/network-scripts<wbr>/ifcfg-eth0<br>
&gt;     &gt;     NM_CONTROLLED=no<br>
&gt;     &gt;     NETMASK=255.255.255.0<br>
&gt;     &gt;     BOOTPROTO=static<br>
&gt;     &gt;     DEVICE=eth0<br>
&gt;     &gt;     IPADDR=192.168.2.200<br>
&gt;     &gt;     GATEWAY=192.168.2.1<br>
&gt;     &gt;     ONBOOT=yes<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt; The same is also true using cloud_init:<br>
&gt;     &gt;<br>
&gt;     &gt;         ovirt.cloud_init =&lt;&lt;EOF<br>
&gt;     &gt;     write_files:<br>
&gt;     &gt;       - content: |<br>
&gt;     &gt;           wat<br>
&gt;     &gt;         path: /tmp/something.txt<br>
&gt;     &gt;         permissions: &#39;0644&#39;<br>
&gt;     &gt;     network-interfaces: |<br>
&gt;     &gt;       auto eth0<br>
&gt;     &gt;       iface eth0 inet static<br>
&gt;     &gt;         address 192.168.2.201<br>
&gt;     &gt;         network 192.168.2.0<br>
&gt;     &gt;         netmask 255.255.255.0<br>
&gt;     &gt;         gateway 192.168.2.1<br>
&gt;     &gt;         dns-nameservers 192.168.2.113 192.168.2.1<br>
&gt;     &gt;     EOF<br>
&gt;     &gt;<br>
&gt;<br>
&gt;     Is this ^ supposed to work in cloud-init? I didn&#39;t find it in the<br>
&gt;     documentation. I thought that the only way to provide network interface<br>
&gt;     configuration is via the &#39;openstack/content/whatever&#39; file within the<br>
&gt;     generated floppy.<br>
&gt;<br>
&gt;     &gt;<br>
&gt;     &gt; and inspection:<br>
&gt;     &gt;<br>
&gt;     &gt;         66:<br>
&gt;      vm_configuration[:initializati<wbr>on][:dns_servers] =<br>
&gt;     &gt;     iface_options[:dns_servers] unless<br>
&gt;     iface_options[:dns_servers].n<wbr>il?<br>
&gt;     &gt;         67:           vm_configuration[:initializat<wbr>ion][:dns_search] =<br>
&gt;     &gt;     iface_options[:dns_search] unless iface_options[:dns_search].nil<wbr>?<br>
&gt;     &gt;         68:           require &#39;pry&#39;<br>
&gt;     &gt;         69:           binding.pry<br>
&gt;     &gt;         70:<br>
&gt;     &gt;      =&gt; 71:           machine.start(<br>
&gt;     &gt;         72:             use_cloud_init: true,<br>
&gt;     &gt;         73:             vm: vm_configuration<br>
&gt;     &gt;         74:           )<br>
&gt;     &gt;         75:<br>
&gt;     &gt;         76:           @app.call(env)<br>
&gt;     &gt;     [1] pry(#&lt;VagrantPlugins::OVirtPro<wbr>vider::Action::StartVM&gt;)&gt;<br>
&gt;     &gt;     vm_configuration<br>
&gt;     &gt;     =&gt; {:initialization=&gt;<br>
&gt;     &gt;       {:host_name=&gt;&quot;test&quot;,<br>
&gt;     &gt;        :nic_configurations=&gt;[{:name=&gt;<wbr>&quot;eth0&quot;, :on_boot=&gt;true,<br>
&gt;     &gt;     :boot_protocol=&gt;&quot;static&quot;, :ip=&gt;{:version=&gt;&quot;v4&quot;,<br>
&gt;     &gt;     :address=&gt;&quot;192.168.2.200&quot;, :gateway=&gt;&quot;192.168.2.1&quot;,<br>
&gt;     &gt;     :netmask=&gt;&quot;255.255.255.0&quot;}}],<br>
&gt;     &gt;        :custom_script=&gt;<br>
&gt;     &gt;         &quot;write_files:\n  - content: |\n      wat\n    path:<br>
&gt;     &gt;     /tmp/something.txt\n    permissions:<br>
&gt;     &#39;0644&#39;\nnetwork-interfaces: |\n<br>
&gt;     &gt;     auto eth0\n  iface eth0 inet static\n    address 192.168.2.201\n<br>
&gt;     &gt;     network 192.168.2.0\n    netmask 255.255.255.0\n    gateway<br>
&gt;     &gt;     192.168.2.1\n    dns-nameservers 192.168.2.113 192.168.2.1\n&quot;,<br>
&gt;     &gt;        :dns_servers=&gt;&quot;192.168.2.1&quot;,<br>
&gt;     &gt;        :dns_search=&gt;&quot;test.local&quot;}}<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt; And here&#39;s my debugging after it comes up:<br>
&gt;     &gt;<br>
&gt;     &gt;     [vagrant@test ~]$ cat /etc/resolv.conf<br>
&gt;     &gt;     # Generated by NetworkManager<br>
&gt;     &gt;     search localdomain<br>
&gt;     &gt;     [vagrant@test ~]$ cat /etc/sysconfig/network-scripts<wbr>/ifcfg-eth0<br>
&gt;     &gt;     NM_CONTROLLED=no<br>
&gt;     &gt;     NETMASK=255.255.255.0<br>
&gt;     &gt;     BOOTPROTO=static<br>
&gt;     &gt;     DEVICE=eth0<br>
&gt;     &gt;     IPADDR=192.168.2.200<br>
&gt;     &gt;     GATEWAY=192.168.2.1<br>
&gt;     &gt;     ONBOOT=yes<br>
&gt;     &gt;     [vagrant@test ~]$ cat /tmp/something.txt<br>
&gt;     &gt;     wat<br>
&gt;     &gt;     [vagrant@test ~]$ ping -c 3 <a href="http://www.google.com" rel="noreferrer" target="_blank">www.google.com</a> &lt;<a href="http://www.google.com" rel="noreferrer" target="_blank">http://www.google.com</a>&gt;<br>
&gt;     &gt;     &lt;<a href="http://www.google.com/" rel="noreferrer" target="_blank">http://www.google.com/</a>&gt;ping: <a href="http://www.google.com" rel="noreferrer" target="_blank">www.google.com</a><br>
&gt;     &lt;<a href="http://www.google.com" rel="noreferrer" target="_blank">http://www.google.com</a>&gt;<br>
&gt;     &gt;     &lt;<a href="http://www.google.com/" rel="noreferrer" target="_blank">http://www.google.com/</a>&gt;: Name or service not known<br>
&gt;     &gt;     [vagrant@test ~]$ echo $&#39;nameserver 192.168.2.113\nnameserver<br>
&gt;     &gt;     192.168.2.1&#39; | sudo tee -a /etc/resolv.conf &gt;/dev/null<br>
&gt;     &gt;     [vagrant@test ~]$ ping -c 3 <a href="http://www.google.com" rel="noreferrer" target="_blank">www.google.com</a> &lt;<a href="http://www.google.com" rel="noreferrer" target="_blank">http://www.google.com</a>&gt;<br>
&gt;     &gt;     &lt;<a href="http://www.google.com/" rel="noreferrer" target="_blank">http://www.google.com/</a>&gt;PING <a href="http://www.google.com" rel="noreferrer" target="_blank">www.google.com</a><br>
&gt;     &lt;<a href="http://www.google.com" rel="noreferrer" target="_blank">http://www.google.com</a>&gt;<br>
&gt;     &gt;     &lt;<a href="http://www.google.com/" rel="noreferrer" target="_blank">http://www.google.com/</a>&gt; (216.58.217.4) 56(84) bytes of data.<br>
&gt;     &gt;     64 bytes from <a href="http://den03s09-in-f4.1e100.net" rel="noreferrer" target="_blank">den03s09-in-f4.1e100.net</a><br>
&gt;     &lt;<a href="http://den03s09-in-f4.1e100.net" rel="noreferrer" target="_blank">http://den03s09-in-f4.1e100.<wbr>net</a>&gt;<br>
</div></div>&gt;     &gt;     &lt;<a href="http://den03s09-in-f4.1e100.net/" rel="noreferrer" target="_blank">http://den03s09-in-f4.1e100.<wbr>net/</a><br>
<span>&gt;     &lt;<a href="http://den03s09-in-f4.1e100.net/" rel="noreferrer" target="_blank">http://den03s09-in-f4.1e100.<wbr>net/</a>&gt;&gt; (216.58.217.4): icmp_seq=1<br>
&gt;     &gt;     ttl=54 time=47.5 ms<br>
&gt;     &gt;     64 bytes from <a href="http://den03s09-in-f4.1e100.net" rel="noreferrer" target="_blank">den03s09-in-f4.1e100.net</a> &lt;<a href="http://den03s09-in-f4.1e100.net" rel="noreferrer" target="_blank">http://den03s09-in-f4.1e100.n<wbr>et</a>&gt;<br>
</span>&gt;     &gt;     &lt;<a href="http://den03s09-in-f4.1e100.net/" rel="noreferrer" target="_blank">http://den03s09-in-f4.1e100.<wbr>net/</a><br>
<span>&gt;     &lt;<a href="http://den03s09-in-f4.1e100.net/" rel="noreferrer" target="_blank">http://den03s09-in-f4.1e100.<wbr>net/</a>&gt;&gt; (216.58.217.4): icmp_seq=2<br>
&gt;     &gt;     ttl=54 time=46.9 ms<br>
&gt;     &gt;     64 bytes from <a href="http://den03s09-in-f4.1e100.net" rel="noreferrer" target="_blank">den03s09-in-f4.1e100.net</a> &lt;<a href="http://den03s09-in-f4.1e100.net" rel="noreferrer" target="_blank">http://den03s09-in-f4.1e100.n<wbr>et</a>&gt;<br>
</span>&gt;     &gt;     &lt;<a href="http://den03s09-in-f4.1e100.net/" rel="noreferrer" target="_blank">http://den03s09-in-f4.1e100.<wbr>net/</a><br>
<div class="gmail-m_5845533094908090176HOEnZb"><div class="gmail-m_5845533094908090176h5">&gt;     &lt;<a href="http://den03s09-in-f4.1e100.net/" rel="noreferrer" target="_blank">http://den03s09-in-f4.1e100.<wbr>net/</a>&gt;&gt; (216.58.217.4): icmp_seq=3<br>
&gt;     &gt;     ttl=54 time=44.3 ms<br>
&gt;     &gt;     --- <a href="http://www.google.com" rel="noreferrer" target="_blank">www.google.com</a> &lt;<a href="http://www.google.com" rel="noreferrer" target="_blank">http://www.google.com</a>&gt;<br>
&gt;     &lt;<a href="http://www.google.com/" rel="noreferrer" target="_blank">http://www.google.com/</a>&gt; ping statistics ---<br>
&gt;     &gt;     3 packets transmitted, 3 received, 0% packet loss, time 2002ms<br>
&gt;     &gt;     rtt min/avg/max/mdev = 44.385/46.307/47.555/1.390 ms<br>
&gt;     &gt;<br>
&gt;<br>
&gt;     Not sure if you did that already, but is very useful to check the<br>
&gt;     content of the floppy that the oVirt engine creates and attaches to the<br>
&gt;     virtual machine. To do so run the virtual machine, then go to the<br>
&gt;     hypervisor where it is running and locate the corresponding &#39;qemu-kvm&#39;<br>
&gt;     process:<br>
&gt;<br>
&gt;       # ps -ef | grep qemu-kvm | grep myvm<br>
&gt;<br>
&gt;     That will have a very long command line, and should have a &#39;payload&#39;<br>
&gt;     option that points to the generated floppy, something like this:<br>
&gt;<br>
&gt;       -drive file=/var/run/vdsm/payload/ae3<wbr>a9cd4-....img<br>
&gt;<br>
&gt;     Copy that file somewhere, and mount it:<br>
&gt;<br>
&gt;       # mount -o loop,ro that_file.img /mnt<br>
&gt;<br>
&gt;     Then explore the content:<br>
&gt;<br>
&gt;       # find /mnt -type f<br>
&gt;       /mnt/openstack/content/0000<br>
&gt;       /mnt/openstack/latest/meta_da<wbr>ta.json<br>
&gt;       /mnt/openstack/latest/user_da<wbr>ta<br>
&gt;<br>
&gt;     The &#39;openstack/content/0000&#39; file should contain your network<br>
&gt;     configuration. Is it what you expected?<br>
&gt;<br>
&gt;     The &#39;openstack/latest/user_data&#39; file should contain the cloud-init<br>
&gt;     ocnfiguration generated by oVirt, which your custom script appended.<br>
&gt;     Does it look correct?<br>
&gt;<br>
&gt;     (Remember to &quot;umount /mnt&quot; when done.)<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
<br>
</div></div></blockquote></div><br></div></div>