Revision 8b3fd458
b/lib/hypervisor/hv_fake.py | ||
---|---|---|
122 | 122 |
try: |
123 | 123 |
fh = file(file_name, "w") |
124 | 124 |
try: |
125 |
fh.write("0\n%d\n%d\n" % (instance.memory, instance.vcpus)) |
|
125 |
fh.write("0\n%d\n%d\n" % |
|
126 |
(instance.beparams[constants.BE_MEMORY], |
|
127 |
instance.beparams[constants.BE_VCPUS])) |
|
126 | 128 |
finally: |
127 | 129 |
fh.close() |
128 | 130 |
except IOError, err: |
b/lib/hypervisor/hv_kvm.py | ||
---|---|---|
176 | 176 |
|
177 | 177 |
kvm = constants.KVM_PATH |
178 | 178 |
kvm_cmd = [kvm] |
179 |
kvm_cmd.extend(['-m', instance.memory])
|
|
180 |
kvm_cmd.extend(['-smp', instance.vcpus])
|
|
179 |
kvm_cmd.extend(['-m', instance.beparams[constants.BE_MEMORY]])
|
|
180 |
kvm_cmd.extend(['-smp', instance.beparams[constants.BE_VCPUS]])
|
|
181 | 181 |
kvm_cmd.extend(['-pidfile', pidfile]) |
182 | 182 |
# used just by the vnc server, if enabled |
183 | 183 |
kvm_cmd.extend(['-name', instance.name]) |
... | ... | |
372 | 372 |
""" |
373 | 373 |
if not os.path.exists(constants.KVM_PATH): |
374 | 374 |
return "The kvm binary ('%s') does not exist." % constants.KVM_PATH |
375 |
|
b/lib/hypervisor/hv_xen.py | ||
---|---|---|
353 | 353 |
config.write("ramdisk = '%s'\n" % initrd_path) |
354 | 354 |
|
355 | 355 |
# rest of the settings |
356 |
config.write("memory = %d\n" % instance.memory)
|
|
357 |
config.write("vcpus = %d\n" % instance.vcpus)
|
|
356 |
config.write("memory = %d\n" % instance.beparams[constants.BE_MEMORY])
|
|
357 |
config.write("vcpus = %d\n" % instance.beparams[constants.BE_VCPUS])
|
|
358 | 358 |
config.write("name = '%s'\n" % instance.name) |
359 | 359 |
|
360 | 360 |
vif_data = [] |
... | ... | |
467 | 467 |
config.write("# this is autogenerated by Ganeti, please do not edit\n#\n") |
468 | 468 |
config.write("kernel = '/usr/lib/xen/boot/hvmloader'\n") |
469 | 469 |
config.write("builder = 'hvm'\n") |
470 |
config.write("memory = %d\n" % instance.memory)
|
|
471 |
config.write("vcpus = %d\n" % instance.vcpus)
|
|
470 |
config.write("memory = %d\n" % instance.beparams[constants.BE_MEMORY])
|
|
471 |
config.write("vcpus = %d\n" % instance.beparams[constants.BE_VCPUS])
|
|
472 | 472 |
config.write("name = '%s'\n" % instance.name) |
473 | 473 |
if instance.hvparams[constants.HV_PAE]: |
474 | 474 |
config.write("pae = 1\n") |
Also available in: Unified diff