Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rancherOS 1.1 fails to configure the static IP set by guest customisation by VMware ESXi (5.5.0) hypervisor #2151

Open
trombini opened this issue Nov 8, 2017 · 2 comments

Comments

@trombini
Copy link

@trombini trombini commented Nov 8, 2017

RancherOS Version: (ros os version)

$ ros -v
ros version v1.1.0

Where are you running RancherOS? (docker-machine, AWS, GCE, baremetal, etc.)

VMware ESXi, version 5.5.0. We connect to the VMware ESXi with the software vCloudDirector (v 8.2)

Issue

rancherOS 1.1 fails to configure the static IP set by guest customisation by VMware ESXi (5.5.0) hypervisor.

This /var/log/boot/cloud-init-save.log log seems to be the most interesting. You can see that it loads the vmware datasource (which is correct), it reads the OVF information from vmtoolsd but it somehow fails to convert the xml into a valid configuration. I think this happens in the function getOvfReadConfig in vmware_amd64.

As a fallback it uses DHCP (which isn't activated for this network) to determine an IP address.

time="2017-11-08T15:04:39Z" level=info msg="Apply Network Config SyncHostname"
time="2017-11-08T15:04:39Z" level=info msg="datasources that will be consided: []string{"configdrive:/media/config-2", "vmware"}"
time="2017-11-08T15:04:39Z" level=info msg="Read from "ovfenv": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Environment\n     xmlns=\"http://schemas.dmtf.org/ovf/environment/1\"\n     xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n     xmlns:oe=\"http://schemas.dmtf.org/ovf/environment/1\"\n     xmlns:ve=\"http://www.vmware.com/schema/ovfenv\"\n     oe:id=\"\"\n     ve:vCenterId=\"vm-376732\">\n   <PlatformSection>\n      <Kind>VMware ESXi</Kind>\n      <Version>5.5.0</Version>\n      <Vendor>VMware, Inc.</Vendor>\n      <Locale>de</Locale>\n   </PlatformSection>\n   <PropertySection>\n         <Property oe:key=\"vCloud_UseSysPrep\" oe:value=\"None\"/>\n         <Property oe:key=\"vCloud_bitMask\" oe:value=\"1\"/>\n         <Property oe:key=\"vCloud_bootproto_0\" oe:value=\"static\"/>\n         <Property oe:key=\"vCloud_computerName\" oe:value=\"rancherOS\"/>\n         <Property oe:key=\"vCloud_dns1_0\" oe:value=\"8.8.8.8\"/>\n         <Property oe:key=\"vCloud_dns2_0\" oe:value=\"8.8.4.4\"/>\n         <Property oe:key=\"vCloud_gateway_0\" oe:value=\"10.10.30.254\"/>\n         <Property oe:key=\"vCloud_ip_0\" oe:value=\"10.10.30.20\"/>\n         <Property oe:key=\"vCloud_macaddr_0\" oe:value=\"00:50:56:01:36:f3\"/>\n         <Property oe:key=\"vCloud_markerid\" oe:value=\"63c75ff8-2617-44f2-87d1-3c4a75884b8d\"/>\n         <Property oe:key=\"vCloud_netmask_0\" oe:value=\"255.255.255.0\"/>\n         <Property oe:key=\"vCloud_numnics\" oe:value=\"1\"/>\n         <Property oe:key=\"vCloud_primaryNic\" oe:value=\"0\"/>\n         <Property oe:key=\"vCloud_reconfigToken\" oe:value=\"963458351\"/>\n         <Property oe:key=\"vCloud_resetPassword\" oe:value=\"0\"/>\n         <Property oe:key=\"vCloud_suffix_0\" oe:value=\"\"/>\n   </PropertySection>\n   <ve:EthernetAdapterSection>\n      <ve:Adapter ve:mac=\"00:50:56:01:36:f3\" ve:network=\"vxw-dvs-155-virtualwire-12185-sid-5005-dvs.VCDVSION_ORCHESTRATION-2c3a1d39-d2bc-\" ve:unitNumber=\"7\"/>\n   </ve:EthernetAdapterSection>\n</Environment>\n"
"
time="2017-11-08T15:04:39Z" level=info msg="Using OVF environment from guestinfo
"
time="2017-11-08T15:04:39Z" level=info msg="cloud-init: Checking availability of "cloud-drive""
time="2017-11-08T15:04:39Z" level=info msg="cloud-init: Checking availability of "VMWare""
time="2017-11-08T15:04:39Z" level=info msg="cloud-init: Datasource available: VMWare:  (lastError: %!s(<nil>))"
time="2017-11-08T15:04:39Z" level=info msg="Fetching user-data from datasource VMWare:  (lastError: %!s(<nil>))"
time="2017-11-08T15:04:39Z" level=info msg="Fetching meta-data from datasource of type VMWare"
time="2017-11-08T15:04:39Z" level=error msg="Unrecognized user-data
()"
time="2017-11-08T15:04:39Z" level=info msg="Wrote to /var/lib/rancher/conf/metadata"
time="2017-11-08T15:04:39Z" level=info msg="not writing /var/lib/rancher/conf/cloud-config.d/network.yml: its all defaults."
time="2017-11-08T15:04:39Z" level=info msg="Cloud-init datasource that was used: VMWare:  (lastError: %!s(<nil>))"

I copied the ovfenv XML file for better readability

<?xml version="1.0" encoding="UTF-8"?>
<Environment xmlns="http://schemas.dmtf.org/ovf/environment/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:oe="http://schemas.dmtf.org/ovf/environment/1" xmlns:ve="http://www.vmware.com/schema/ovfenv" oe:id="" ve:vCenterId="vm-376732">
  <PlatformSection>
    <Kind>VMware ESXi</Kind>
    <Version>5.5.0</Version>
    <Vendor>VMware, Inc.</Vendor>
    <Locale>de</Locale>
  </PlatformSection>
  <PropertySection>
    <Property oe:key="vCloud_UseSysPrep" oe:value="None"/>
    <Property oe:key="vCloud_bitMask" oe:value="1"/>
    <Property oe:key="vCloud_bootproto_0" oe:value="static"/>
    <Property oe:key="vCloud_computerName" oe:value="rancherOS"/>
    <Property oe:key="vCloud_dns1_0" oe:value="8.8.8.8"/>
    <Property oe:key="vCloud_dns2_0" oe:value="8.8.4.4"/>
    <Property oe:key="vCloud_gateway_0" oe:value="10.10.30.254"/>
    <Property oe:key="vCloud_ip_0" oe:value="10.10.30.20"/>
    <Property oe:key="vCloud_macaddr_0" oe:value="00:50:56:01:36:f3"/>
    <Property oe:key="vCloud_markerid" oe:value="63c75ff8-2617-44f2-87d1-3c4a75884b8d"/>
    <Property oe:key="vCloud_netmask_0" oe:value="255.255.255.0"/>
    <Property oe:key="vCloud_numnics" oe:value="1"/>
    <Property oe:key="vCloud_primaryNic" oe:value="0"/>
    <Property oe:key="vCloud_reconfigToken" oe:value="963458351"/>
    <Property oe:key="vCloud_resetPassword" oe:value="0"/>
    <Property oe:key="vCloud_suffix_0" oe:value=""/>
  </PropertySection>
  <ve:EthernetAdapterSection>
    <ve:Adapter ve:mac="00:50:56:01:36:f3" ve:network="vxw-dvs-155-virtualwire-12185-sid-5005-dvs.VCDVSION_ORCHESTRATION-2c3a1d39-d2bc-" ve:unitNumber="7"/>
  </ve:EthernetAdapterSection>
</Environment>

Obviously the OVF XML is missing the right keys for "guestinfo.hostname" etc etc. Is there a way to support these default vCloudDirector keys such as vCloud_ip_0?

@trombini trombini changed the title rancherOS 1.1 fails to set the static IP set by guest customisation of a VMware ESXi (5.5.0) hypervisor rancherOS 1.1 fails to configure the static IP set by guest customisation by VMware ESXi (5.5.0) hypervisor Nov 8, 2017
@liyimeng

This comment has been minimized.

Copy link

@liyimeng liyimeng commented Nov 10, 2017

@trombini I experienced similar issue in kvm, I think your problem is that configuration file in config drive should be in cloud-init format, NOT xml format.

when you set your datasources as {"configdrive:/media/config-2", "vmware"}, it dose not mean that your config on the driver should be read as vmware format. Instead, it means two independent sources.

@trombini

This comment has been minimized.

Copy link
Author

@trombini trombini commented Nov 10, 2017

@liyimeng The configdrive datasource seems to be a default of the rancherOS and is actually not available in my VMware ESXi / vCloudDirector environment. The file or mount point /media/config-2 doesn't exist.

I wonder "who" is responsible for providing the correct OVF for the "vmware" datasource. My vCloudDirector, VMware ESXi environment does not create it from scratch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.