Revision a5728081 scripts/gnt-instance
b/scripts/gnt-instance | ||
---|---|---|
355 | 355 |
(didx, err)) |
356 | 356 |
disks[didx] = ddict |
357 | 357 |
|
358 |
ValidateBeParams(opts.beparams) |
|
359 |
|
|
360 |
## kernel_path = _TransformPath(opts.kernel_path) |
|
361 |
## initrd_path = _TransformPath(opts.initrd_path) |
|
362 |
|
|
363 |
## hvm_acpi = opts.hvm_acpi == _VALUE_TRUE |
|
364 |
## hvm_pae = opts.hvm_pae == _VALUE_TRUE |
|
365 |
|
|
366 |
## if ((opts.hvm_cdrom_image_path is not None) and |
|
367 |
## (opts.hvm_cdrom_image_path.lower() == constants.VALUE_NONE)): |
|
368 |
## hvm_cdrom_image_path = None |
|
369 |
## else: |
|
370 |
## hvm_cdrom_image_path = opts.hvm_cdrom_image_path |
|
358 |
utils.ForceDictType(opts.beparams, constants.BES_PARAMETER_TYPES) |
|
359 |
utils.ForceDictType(opts.hvparams, constants.HVS_PARAMETER_TYPES) |
|
371 | 360 |
|
372 | 361 |
op = opcodes.OpCreateInstance(instance_name=instance, |
373 | 362 |
disks=disks, |
... | ... | |
492 | 481 |
|
493 | 482 |
nic0 = {'ip': specs['ip'], 'bridge': specs['bridge'], 'mac': specs['mac']} |
494 | 483 |
|
484 |
utils.ForceDictType(specs['backend'], constants.BES_PARAMETER_TYPES) |
|
485 |
utils.ForceDictType(hvparams, constants.HVS_PARAMETER_TYPES) |
|
486 |
|
|
495 | 487 |
op = opcodes.OpCreateInstance(instance_name=name, |
496 | 488 |
disks=disks, |
497 | 489 |
disk_template=specs['template'], |
... | ... | |
1187 | 1179 |
if isinstance(opts.beparams[param], basestring): |
1188 | 1180 |
if opts.beparams[param].lower() == "default": |
1189 | 1181 |
opts.beparams[param] = constants.VALUE_DEFAULT |
1190 |
elif opts.beparams[param].lower() == "none": |
|
1191 |
opts.beparams[param] = constants.VALUE_NONE |
|
1192 |
elif param == constants.BE_MEMORY: |
|
1193 |
opts.beparams[constants.BE_MEMORY] = \ |
|
1194 |
utils.ParseUnit(opts.beparams[constants.BE_MEMORY]) |
|
1182 |
|
|
1183 |
utils.ForceDictType(opts.beparams, constants.BES_PARAMETER_TYPES, |
|
1184 |
allowed_values=[constants.VALUE_DEFAULT]) |
|
1195 | 1185 |
|
1196 | 1186 |
for param in opts.hypervisor: |
1197 | 1187 |
if isinstance(opts.hypervisor[param], basestring): |
1198 | 1188 |
if opts.hypervisor[param].lower() == "default": |
1199 | 1189 |
opts.hypervisor[param] = constants.VALUE_DEFAULT |
1200 |
elif opts.hypervisor[param].lower() == "none": |
|
1201 |
opts.hypervisor[param] = constants.VALUE_NONE |
|
1190 |
|
|
1191 |
utils.ForceDictType(opts.hypervisor, constants.HVS_PARAMETER_TYPES, |
|
1192 |
allowed_values=[constants.VALUE_DEFAULT]) |
|
1202 | 1193 |
|
1203 | 1194 |
for idx, (nic_op, nic_dict) in enumerate(opts.nics): |
1204 | 1195 |
try: |
Also available in: Unified diff