Project

General

Profile

Bug #8528

Provisioning on a non-clustered ESXi

Added by Thomas Linck over 7 years ago. Updated about 5 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
Compute resources - VMware
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

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.

production.log production.log 41.3 KB Thomas Linck, 11/27/2014 10:46 AM
provisioning_failure.log provisioning_failure.log 6.24 KB Anthony Lapenna, 11/28/2014 03:58 AM

Related issues

Has duplicate Foreman - Bug #14814: VM provisioning using FormanDuplicate2016-04-26
Is duplicate of Foreman - Feature #1945: Better VMWare support for non-clusters setupClosed

History

#1 Updated by Dominic Cleal over 7 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.

#2 Updated by Dominic Cleal over 7 years ago

  • Related to Feature #1945: Better VMWare support for non-clusters setup added

#3 Updated by Thomas Linck over 7 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..

#4 Updated by Dominic Cleal over 7 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.

#5 Updated by Anthony Lapenna over 7 years ago

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.

#6 Updated by Anthony Lapenna over 7 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.

#7 Updated by Dominic Cleal over 7 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?

#8 Updated by Hans Maulwurf over 7 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 ?

#9 Updated by William Hefter over 7 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.

#10 Updated by Shlomi Zadok over 7 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)

#11 Updated by Anthony Lapenna over 7 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."

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

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[...]"

#12 Updated by Anthony Lapenna over 7 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[...]"

#13 Updated by Shlomi Zadok over 7 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

#14 Updated by Thomas Linck over 7 years ago

Any news about this ticket?

#15 Updated by Claude Juif over 7 years ago

I can confirm this bug is still present in foreman 1.7.2

#16 Updated by Dominic Cleal over 7 years ago

  • Related to deleted (Feature #1945: Better VMWare support for non-clusters setup)

#17 Updated by Dominic Cleal over 7 years ago

  • Blocks Feature #1945: Better VMWare support for non-clusters setup added

#18 Updated by Yama Kasi about 7 years ago

Is it not possible to do an !Ifstatement for VMWARE/ESXI/Vpshere on this line ?

https://github.com/theforeman/foreman/blob/1.7.0-RC2/app/models/concerns/orchestration/compute.rb#L146

#19 Updated by Dominic Cleal about 6 years ago

  • Has duplicate Bug #14814: VM provisioning using Forman added

#20 Updated by Patrick GreƟ about 5 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

#21 Updated by Anonymous about 5 years ago

  • Status changed from New to Duplicate

duplicates #1945, AFAICT

#22 Updated by Anonymous about 5 years ago

  • Blocks deleted (Feature #1945: Better VMWare support for non-clusters setup)

#23 Updated by Anonymous about 5 years ago

  • Is duplicate of Feature #1945: Better VMWare support for non-clusters setup added

Also available in: Atom PDF