diff --git a/lib/vmpooler/pool_manager.rb b/lib/vmpooler/pool_manager.rb index 7cb1af6..eb9504f 100644 --- a/lib/vmpooler/pool_manager.rb +++ b/lib/vmpooler/pool_manager.rb @@ -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