[Solved] Can not set ip address to vm in VM Provisioning Automation

automate

#1

ip_addr, netmask, gateway are not set in VM provisioning. I get these values from a Service or Provision Dialog and process, but the VM is not configured. No IP Address is set. No errors appears in Automation Log. Do you know why this is happening?


#2

What’s your provider type, and what’s the operating system of the VM that you’re hoping to configure? Are you using a VMware customization specification, or cloud-init script for example?

pemcg


#3

VMWare, VM OS is Centos(vmware tools installed). I test:

  • Default Provision Dialog (there is no way to enable VMWare customization specification.
  • Set :sysprep_custom_spec => true, in automation.
    In both cases the result is the same: ip_addr is not set.

#4

@andrescueva

How are you trying to set the ip_addr? I assume you are trying to set it such that it gets injected with the cloudinit?

Blue skies,
Ian


#5

@andrescueva
If I recall correctly, you need to set the custom spec that you are trying to use. If you check the ManageIQ Domain and look at /Infrastructure/VM/Provisioning/StateMachines/Methods/vmware_CustomizeRequest you can see the method set_customspec. set_customspec is looking for the variable sysprep_custom_spec.


#6

Make sure perl package is also installed on your template. It is a requirement for VMware Tools.


#7

I get it, but there is no documentation about sysprep_custom_spec. Can you give me an example or reference?


#10

In this example, I check to see which platform the template is using and then choose the corresponding custom spec and then set it on the task object.

if @template.platform == "linux"
  customization_spec = "Linux-Spec-Name"
elsif @template.platform == "windows"
  customization_spec = "Windows-Spec-Name"
end
@task.set_customization_spec(customization_spec, true)

#11

“Linux-Spec-Name” and “Windows-Spec-Name”, where i can find the values i can pass as argument? Thanks for your help.


#12

The customisation specs need to have been created in the vSphere console, then CloudForms will see them.


#13

Thanks everyone. I made it. You both had the answer @pemcg @jnovotni.