Project

General

Profile

Actions

Bug #8528

closed

Provisioning on a non-clustered ESXi

Added by Thomas Linck over 9 years ago. Updated almost 7 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
Compute resources - VMware
Target version:
-
Difficulty:
Triaged:
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.


Files

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 2 (0 open2 closed)

Has duplicate Foreman - Bug #14814: VM provisioning using FormanDuplicate04/26/2016Actions
Is duplicate of Foreman - Feature #1945: Better VMWare support for non-clusters setupClosedChris RobertsActions
Actions #1

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.

Actions #2

Updated by Dominic Cleal over 9 years ago

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

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..

Actions #4

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.

Actions #5

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

Actions #6

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.

Actions #7

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?

Actions #8

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 ?

Actions #9

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.

Actions #10

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)

Actions #11

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

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

Actions #12

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

Actions #13

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

Actions #14

Updated by Thomas Linck over 9 years ago

Any news about this ticket?

Actions #15

Updated by Claude Juif about 9 years ago

I can confirm this bug is still present in foreman 1.7.2

Actions #16

Updated by Dominic Cleal about 9 years ago

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

Updated by Dominic Cleal about 9 years ago

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

Updated by Yama Kasi almost 9 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

Actions #19

Updated by Dominic Cleal almost 8 years ago

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

Updated by Patrick Greß about 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

Actions #21

Updated by Anonymous almost 7 years ago

  • Status changed from New to Duplicate

duplicates #1945, AFAICT

Actions #22

Updated by Anonymous almost 7 years ago

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

Updated by Anonymous almost 7 years ago

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

Also available in: Atom PDF