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:
parent
4de4195f74
commit
6491ca9208
@ -272,6 +272,15 @@ cmd=CommandParser::CmdParser.new(ARGV) do
|
|||||||
|
|
||||||
rc = one_v.allocate(v[:one])
|
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)
|
if ::OpenNebula.is_error?(rc)
|
||||||
STDOUT.puts " Error creating Virtual Machine: "\
|
STDOUT.puts " Error creating Virtual Machine: "\
|
||||||
"#{rc.message}\n"
|
"#{rc.message}\n"
|
||||||
|
@ -271,6 +271,7 @@ class VIClient
|
|||||||
|
|
||||||
tmp = vms.select { |v|
|
tmp = vms.select { |v|
|
||||||
# Get rid of VM Templates and VMs not in running state
|
# Get rid of VM Templates and VMs not in running state
|
||||||
|
v.config &&
|
||||||
v.config.template != true &&
|
v.config.template != true &&
|
||||||
v.summary.runtime.powerState == "poweredOn"
|
v.summary.runtime.powerState == "poweredOn"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user