Bug #4009: Importing vms from EC2 provides a wrong CPU value

(cherry picked from commit 8023e2146e426b7ca373c74ac632c25988524aad)
This commit is contained in:
Jaime Melis committed 2015-10-07 18:03:48 +02:00
1 parent 6b897742ee
commit fd1a050e08
1 file changed
+4 -2
+4 -2
View File
@@ -592,11 +592,13 @@ private
def vm_to_one(instance)
cpu, mem = instance_type_capacity(instance.instance_type)
mem = mem.to_i / 1024 # Memory for templates expressed in MB
cpu = cpu.to_f / 100
vcpu = cpu.ceil
mem = mem.to_i / 1024 # Memory for templates expressed in MB
str = "NAME = \"Instance from #{instance.id}\"\n"\
"CPU = \"#{cpu}\"\n"\
"vCPU = \"#{cpu}\"\n"\
"VCPU = \"#{vcpu}\"\n"\
"MEMORY = \"#{mem}\"\n"\
"HYPERVISOR = \"ec2\"\n"\
"PUBLIC_CLOUD = [\n"\