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 vmsphere_vm type's create_command 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 puppet.etsu.edu
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/i_ran in the new VM, but there's nothing there. It looks like the create_command 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?
↧