Ask Your Question

vmsphere / vmsphere_vm's create_command not completing?

asked 2015-12-07 19:05:38 -0500

IanD gravatar image

We've just recently started messing with the vmsphere module for cataloging / defining some of our VMs. The initial integration with vCenter/vSphere was easy but I can't get the vmspherevm type's createcommand parameter to work. I had written a short script to set some static networking stuff on creation but it appeared the script would run (it's in the agent run output) but didn't seem to have any affect.

To double check, I made a simple test:

vsphere_vm { '/LCH DataCenter/vm/Drupal/drupal1':
ensure => running,
source => '/LCH DataCenter/vm/Templates/centos7_base',
source_type => 'template',
resource_pool => 'Cluster1',
memory => 1024,
cpus   => 1,
create_command => { command => '/usr/bin/touch',
                    arguments => '/root/i_ran',
                    user => 'root',
                    password => 'xxxxxxx',

On the agent run you can see that /usr/bin/touch ran:

[root@puppet ~]# puppet agent -t
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for
WARNING: Nokogiri was built against LibXML version 2.9.2, but has dynamically loaded 2.9.1
Info: Applying configuration version '1449521042'
Info: Checking if machine /LCH DataCenter/vm/Drupal/drupal1 exists
Info: Creating machine /LCH DataCenter/vm/Drupal/drupal1
Info: Ran /usr/bin/touch, started with PID 2279
Notice: /Stage[main]/Virtualmachines::Drupal/Vsphere_vm[/LCH DataCenter/vm/Drupal/drupal1]/ensure: changed absent to running
Notice: Applied catalog in 44.50 seconds

So what I expected to see was an empty file at /root/iran in the new VM, but there's nothing there. It looks like the createcommand runs but there's no results on the new VM.

Am I missing something really obvious or is not how it's supposed to work?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-12-08 10:16:34 -0500

reesek gravatar image

Not sure if this is going to help, other than to say mine works. I'm running RedHat 6.5, and here is my manifest:

The one attribute I see missing from your example above is 'working_directory', which I know defaults to / but just an observation.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-12-07 19:05:38 -0500

Seen: 67 times

Last updated: Dec 07 '15