1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-23 17:33:56 +03:00

Feature #3383: Add automatic deploy for importing running vcenter VMs

This commit is contained in:
Tino Vazquez 2015-02-06 13:39:45 +01:00
parent 4de4195f74
commit 6491ca9208
2 changed files with 10 additions and 0 deletions

View File

@ -272,6 +272,15 @@ cmd=CommandParser::CmdParser.new(ARGV) do
rc = one_v.allocate(v[:one])
if ::OpenNebula.is_error?(rc)
STDOUT.puts " Error creating Virtual Machine: "\
"#{rc.message}\n"
end
host_id = OpenNebulaHelper.rname_to_id(v[:host], "HOST")
rc = one_v.deploy host_id
if ::OpenNebula.is_error?(rc)
STDOUT.puts " Error creating Virtual Machine: "\
"#{rc.message}\n"

View File

@ -271,6 +271,7 @@ class VIClient
tmp = vms.select { |v|
# Get rid of VM Templates and VMs not in running state
v.config &&
v.config.template != true &&
v.summary.runtime.powerState == "poweredOn"
}