Revision 7767bbf5
b/lib/cmdlib.py | ||
---|---|---|
1042 | 1042 |
if the given volume group is valid. |
1043 | 1043 |
|
1044 | 1044 |
""" |
1045 |
|
|
1046 | 1045 |
if not self.op.vg_name: |
1047 | 1046 |
instances = [self.cfg.GetInstanceInfo(name) |
1048 | 1047 |
for name in self.cfg.GetInstanceList()] |
... | ... | |
3907 | 3906 |
return result |
3908 | 3907 |
|
3909 | 3908 |
|
3910 |
class LUSetInstanceParms(LogicalUnit): |
|
3909 |
class LUSetInstanceParams(LogicalUnit):
|
|
3911 | 3910 |
"""Modifies an instances's parameters. |
3912 | 3911 |
|
3913 | 3912 |
""" |
... | ... | |
3959 | 3958 |
self.kernel_path = getattr(self.op, "kernel_path", None) |
3960 | 3959 |
self.initrd_path = getattr(self.op, "initrd_path", None) |
3961 | 3960 |
self.hvm_boot_order = getattr(self.op, "hvm_boot_order", None) |
3962 |
all_parms = [self.mem, self.vcpus, self.ip, self.bridge, self.mac, |
|
3963 |
self.kernel_path, self.initrd_path, self.hvm_boot_order] |
|
3964 |
if all_parms.count(None) == len(all_parms):
|
|
3961 |
all_params = [self.mem, self.vcpus, self.ip, self.bridge, self.mac,
|
|
3962 |
self.kernel_path, self.initrd_path, self.hvm_boot_order]
|
|
3963 |
if all_params.count(None) == len(all_params):
|
|
3965 | 3964 |
raise errors.OpPrereqError("No changes submitted") |
3966 | 3965 |
if self.mem is not None: |
3967 | 3966 |
try: |
b/lib/mcpu.py | ||
---|---|---|
74 | 74 |
opcodes.OpConnectConsole: cmdlib.LUConnectConsole, |
75 | 75 |
opcodes.OpQueryInstances: cmdlib.LUQueryInstances, |
76 | 76 |
opcodes.OpQueryInstanceData: cmdlib.LUQueryInstanceData, |
77 |
opcodes.OpSetInstanceParms: cmdlib.LUSetInstanceParms,
|
|
77 |
opcodes.OpSetInstanceParams: cmdlib.LUSetInstanceParams,
|
|
78 | 78 |
# os lu |
79 | 79 |
opcodes.OpDiagnoseOS: cmdlib.LUDiagnoseOS, |
80 | 80 |
# exports lu |
b/lib/opcodes.py | ||
---|---|---|
349 | 349 |
__slots__ = ["instances"] |
350 | 350 |
|
351 | 351 |
|
352 |
class OpSetInstanceParms(OpCode): |
|
352 |
class OpSetInstanceParams(OpCode):
|
|
353 | 353 |
"""Change the parameters of an instance.""" |
354 |
OP_ID = "OP_INSTANCE_SET_PARMS" |
|
354 |
OP_ID = "OP_INSTANCE_SET_PARAMS"
|
|
355 | 355 |
__slots__ = [ |
356 | 356 |
"instance_name", "mem", "vcpus", "ip", "bridge", "mac", |
357 | 357 |
"kernel_path", "initrd_path", "hvm_boot_order", |
b/scripts/gnt-instance | ||
---|---|---|
635 | 635 |
return retcode |
636 | 636 |
|
637 | 637 |
|
638 |
def SetInstanceParms(opts, args): |
|
638 |
def SetInstanceParams(opts, args):
|
|
639 | 639 |
"""Modifies an instance. |
640 | 640 |
|
641 | 641 |
All parameters take effect only at the next restart of the instance. |
... | ... | |
661 | 661 |
else: |
662 | 662 |
hvm_boot_order = opts.hvm_boot_order |
663 | 663 |
|
664 |
op = opcodes.OpSetInstanceParms(instance_name=args[0], mem=opts.mem, |
|
665 |
vcpus=opts.vcpus, ip=opts.ip, |
|
666 |
bridge=opts.bridge, mac=opts.mac, |
|
667 |
kernel_path=opts.kernel_path, |
|
668 |
initrd_path=opts.initrd_path, |
|
669 |
hvm_boot_order=hvm_boot_order) |
|
664 |
op = opcodes.OpSetInstanceParams(instance_name=args[0], mem=opts.mem,
|
|
665 |
vcpus=opts.vcpus, ip=opts.ip,
|
|
666 |
bridge=opts.bridge, mac=opts.mac,
|
|
667 |
kernel_path=opts.kernel_path,
|
|
668 |
initrd_path=opts.initrd_path,
|
|
669 |
hvm_boot_order=hvm_boot_order)
|
|
670 | 670 |
result = SubmitOpCode(op) |
671 | 671 |
|
672 | 672 |
if result: |
... | ... | |
832 | 832 |
], |
833 | 833 |
"[-s|-p|-n NODE] <instance>", |
834 | 834 |
"Replaces all disks for the instance"), |
835 |
'modify': (SetInstanceParms, ARGS_ONE, |
|
835 |
'modify': (SetInstanceParams, ARGS_ONE,
|
|
836 | 836 |
[DEBUG_OPT, FORCE_OPT, |
837 | 837 |
cli_option("-m", "--memory", dest="mem", |
838 | 838 |
help="Memory size", |
Also available in: Unified diff