mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 10:08:40 -05:00
Merge branch 'master' into external_redis
This commit is contained in:
commit
3eb60665c2
9 changed files with 282 additions and 11 deletions
|
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/ruby
|
||||
|
||||
require 'json'
|
||||
require 'rbvmomi'
|
||||
require 'redis'
|
||||
require 'time'
|
||||
|
|
@ -166,9 +167,12 @@ def clone_vm template, pool, folder, datastore
|
|||
|
||||
# Annotate with creation time, origin template, etc.
|
||||
configSpec = RbVmomi::VIM.VirtualMachineConfigSpec(
|
||||
:annotation =>
|
||||
'Base template: ' + vm['template'] + "\n" +
|
||||
'Creation time: ' + Time.now.strftime("%Y-%m-%d %H:%M")
|
||||
:annotation => JSON.pretty_generate({
|
||||
name: vm['hostname'],
|
||||
created_by: $config[:vsphere]['username'],
|
||||
base_template: vm['template'],
|
||||
creation_timestamp: Time.now.utc
|
||||
})
|
||||
)
|
||||
|
||||
# Put the VM in the specified folder and resource pool
|
||||
|
|
@ -369,9 +373,10 @@ def check_pool pool
|
|||
$redis.scard('vmware_host_pool__pending__'+pool['name'])
|
||||
|
||||
begin
|
||||
$graphite.log(
|
||||
'vcloud.ready.'+pool['name'], $redis.scard('vmware_host_pool__ready__'+pool['name'])
|
||||
) if defined? $graphite
|
||||
if (defined? $graphite)
|
||||
$graphite.log('vcloud.ready.'+pool['name'], $redis.scard('vmware_host_pool__ready__'+pool['name']))
|
||||
$graphite.log('vcloud.running.'+pool['name'], $redis.scard('vmware_host_pool__running__'+pool['name']))
|
||||
end
|
||||
rescue
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue