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

This commit is contained in:
Jaime Melis committed 2015-10-07 18:03:17 +02:00
1 parent 84ca46d2dc
commit c80e6a275a
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"\