mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 01:58:41 -05:00
add guestinfo.hostname to VirtualMachineConfigSpecs
This commit adds a custom guestinfo keyword and hostname variable that allows the VMware Tools to query the hostname.
This commit is contained in:
parent
36f83fef82
commit
6b9bcc4307
1 changed files with 7 additions and 1 deletions
|
|
@ -197,13 +197,19 @@ module Vmpooler
|
|||
$redis.hset('vmpooler__vm__' + vm['hostname'], 'template', vm['template'])
|
||||
|
||||
# Annotate with creation time, origin template, etc.
|
||||
# Add extraconfig options that can be queried by vmtools
|
||||
configSpec = RbVmomi::VIM.VirtualMachineConfigSpec(
|
||||
annotation: JSON.pretty_generate(
|
||||
name: vm['hostname'],
|
||||
created_by: $config[:vsphere]['username'],
|
||||
base_template: vm['template'],
|
||||
creation_timestamp: Time.now.utc
|
||||
)
|
||||
),
|
||||
extraConfig: [
|
||||
{ key: 'guestinfo.hostname',
|
||||
value: vm['hostname']
|
||||
}
|
||||
]
|
||||
)
|
||||
|
||||
# Choose a clone target
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue