Vmware template based provisioning

Hello,

I was trying to provision server with Vmware template image by using user data template, i am able to provision server but looks it has limited functionality for example i cannot use ‘runcmd’ or manage_resolve_conf or puppet in user data

Does anyone has any suggestion to use cloud-init ? I looked at vmware_clone.rb and realized it has limited functinality.

Any suggestion how i can initiate puppet agent run and register server using subscription manager to correct activation key. (Without using “at” :slight_smile: )

Thanks

perhaps @TimoGoebel can assist?

This is basically a limitation by vSphere. To work around this I created the foreman_userdata Plugin a while ago.
I guess, I should extend the README there a bit.

Basically, you can do a two step process:

  1. use vsphere’s clone spec (Foreman user-data template) to set the ip and hostname of the cloned vm.
  2. use cloud-init and the cloud-init template (added by the plugin) to actually run cloud-init & puppet on the vm.

I hope, that helps. I’ll extend the plugin’s README later with some sample templates.

1 Like

Thank You @TimoGoebel, looking forward to readme,

I looked at your plugin but not getting idea, i think before creating image i need to install cloud-init software and then setup 10_foreman.cfg , once done create image

And starting provision it will call foreman/satellite for post ?

Thanks,
D

@TimoGoebel, i have some query if you can help me to understand,

  1. forman’s userdata template is transferred to vCenter using port 443
  2. Using user_data template vCentre will then create VM and configures IP, DNS and Hostname, here what network ports are require vCentre <-> satellite and vCentre <-> VM tools on guest

I want to understand it because i have firewall between satellite master and Guest and vCenter and Guest, satellite master and vCentre.

Thanks

I don’t think anything more is required then for (1).
If you use the userdata plugin and cloud-init, then the VM has to be able to reach the Foreman (read: Satellite 6) server on tcp/443.