Bug #8528
closedProvisioning on a non-clustered ESXi
Description
Hello,
To follow our discussion on IRC with <shlomizadok>, we are having an issue on provisioning new hosts on ESXi plateform.
We are using foreman and fog in nightly revision for testing purpose but issue is still present.
While provisioning a new host, we get the UI warning : "mac address can't be blank" and the logs show the stack trace attached.
Our environment is the following:
Foreman : Version: 1.6.1-1
Fog : 1.25.0
ESXi : 5.0
We DO NOT have VCenter, the fix to use a VDS Private1 is not applicable here.
Files
Updated by Dominic Cleal over 9 years ago
This log file mostly seems to show that deletion of the VM is failing, as Foreman is trying to roll back the host creation process. That only happens when the MAC address from the VM can't be retrieved.
It would be valuable to see from logs on the VMware side, if such a thing exists, whether the VM was successfully created or not.
Updated by Dominic Cleal over 9 years ago
- Related to Feature #1945: Better VMWare support for non-clusters setup added
Updated by Thomas Linck over 9 years ago
No way to get any interesting logs on VMWare side.
The VM is fully created(with expected params) but when foreman try to recover UUID (MAC?) it's not able to. We can see in vSphere something is trying to recover something.. nothing more..
Updated by Dominic Cleal over 9 years ago
Ah, so if it's created that makes it more interesting, as it's getting further. I take it the VM continues running OK? Is a UUID visible from VMware? What if you go to Infrastructure > Compute Resources and browse to the VM - is it listed, and is the UUID visible in the URL?
I just re-read the code that's being triggered: https://github.com/theforeman/foreman/blob/1.7.0-RC2/app/models/concerns/orchestration/compute.rb#L115
Maybe it is the UUID rather than the MAC as you say, as it first iterates to find the UUID, then the MAC, and it's feasible that uuid.blank? is true, which causes delCompute to fail (maybe this step should be skipped if uuid wasn't yet found).
I'd suggest commenting out the delCompute line and see which of the two following messages (about being blank, or used by another host) is seen.
Updated by Anthony Lapenna over 9 years ago
- File provisioning_failure.log provisioning_failure.log added
So, we've updated our setup:
Foreman: 1.7.0-RC2
Fog: 1.25.0
We are still not able to provision a VM, but this time Foreman is able to create and delete the VM during the rollback phasis. But we're still having an issue with the blank mac value.
See the attachment for the logs.
Updated by Anthony Lapenna over 9 years ago
New test:
We've commented the line: https://github.com/theforeman/foreman/blob/1.7.0-RC2/app/models/concerns/orchestration/compute.rb#L146
So the VM is not deleted on rollback. After that, we've checked the VM attributes in compute resources and seen that there is no associated MAC value with the VM.
Updated by Dominic Cleal over 9 years ago
To add to the story, it was observed that the MAC is generated when the VM is booted up for the first time.
Foreman usually creates the VM, fetches the UUID and MAC, creates DHCP and TFTP records for that MAC, and then powers it up once those are ready.
Shlomi, you worked on #1945, did you observe the same behaviour with MAC generation?
Updated by Hans Maulwurf over 9 years ago
Hi there, I also have the same problem with provisoning vm's without vsphere.
I am using the latest nightly and cant deploy without a cluster.
Do i do something wrong or s it going to be in the next nightly releases ?
Updated by William Hefter over 9 years ago
I can confirm that this is due to ESXi 5.0 (have no other version on hand) generates the MAC on the VM's first bootup, not on VM creation, as seen when manually creating a VM through vSphere Client.
Updated by Shlomi Zadok over 9 years ago
Dominic, on vsphere the mac is created when the vm is created (and returns to foreman, via fog and updates the host.)
It seems that on ESXi, the mac is created on the first time the vm is booted (which is kinda late for us)
Updated by Anthony Lapenna over 9 years ago
As stated in the documentation: "Upon virtual machine creation, ESX/ESXi or vCenter Server systems assign each virtual network interface its own unique MAC address."
Maybe you can set the addressType of the VirtualEthernetCard to generated, if you got access to that item/field.
"
[...]
Virtual Network Interfaces
You can add a virtual network interface to a virtual machine using a subclass of VirtualEthernetCard, you can set the addressType to Manual, Generated, or Assigned. If you choose Assigned, you can specify a MAC address explicitly[...]"
Updated by Anthony Lapenna over 9 years ago
Anthony Lapenna wrote:
As stated in the documentation: "Upon virtual machine creation, ESX/ESXi or vCenter Server systems assign each virtual network interface its own unique MAC address."
From: https://pubs.vmware.com/vsphere-55/index.jsp#com.vmware.wssdk.pg.doc/PG_VM_Config.12.4.html?path=7_0_0_1_9_2_5#1115910 (Network part)
Maybe you can set the addressType of the VirtualEthernetCard to generated, if you got access to that item/field.
"
[...]
Virtual Network Interfaces
You can add a virtual network interface to a virtual machine using a subclass of VirtualEthernetCard, you can set the addressType to Manual, Generated, or Assigned. If you choose Assigned, you can specify a MAC address explicitly[...]"
Updated by Shlomi Zadok over 9 years ago
Hey,
Still investigating this issue.
Regarding your suggestion to set the addressType please note that it is already set in fog.
See https://github.com/fog/fog/blob/master/lib/fog/vsphere/requests/compute/create_vm.rb#L80
Updated by Claude Juif over 9 years ago
I can confirm this bug is still present in foreman 1.7.2
Updated by Dominic Cleal over 9 years ago
- Related to deleted (Feature #1945: Better VMWare support for non-clusters setup)
Updated by Dominic Cleal over 9 years ago
- Blocks Feature #1945: Better VMWare support for non-clusters setup added
Updated by Yama Kasi about 9 years ago
Is it not possible to do an !Ifstatement for VMWARE/ESXI/Vpshere on this line ?
Updated by Dominic Cleal over 8 years ago
- Has duplicate Bug #14814: VM provisioning using Forman added
Updated by Patrick Greß over 7 years ago
Hey there,
are there any news to this bug? I would really appreciate being able to use foreman with my standalone hypervisor.
Greetings,
pgress
Updated by Anonymous about 7 years ago
- Status changed from New to Duplicate
duplicates #1945, AFAICT
Updated by Anonymous about 7 years ago
- Blocks deleted (Feature #1945: Better VMWare support for non-clusters setup)
Updated by Anonymous about 7 years ago
- Is duplicate of Feature #1945: Better VMWare support for non-clusters setup added