Revision 1862d460 scripts/gnt-instance
b/scripts/gnt-instance | ||
---|---|---|
226 | 226 |
snode=snode, vcpus=opts.vcpus, |
227 | 227 |
ip=opts.ip, bridge=opts.bridge, |
228 | 228 |
start=opts.start, ip_check=opts.ip_check, |
229 |
wait_for_sync=opts.wait_for_sync) |
|
229 |
wait_for_sync=opts.wait_for_sync, mac=opts.mac)
|
|
230 | 230 |
SubmitOpCode(op) |
231 | 231 |
return 0 |
232 | 232 |
|
... | ... | |
624 | 624 |
Opts used: |
625 | 625 |
memory - the new memory size |
626 | 626 |
vcpus - the new number of cpus |
627 |
mac - the new MAC address of the instance |
|
627 | 628 |
|
628 | 629 |
""" |
629 |
if not opts.mem and not opts.vcpus and not opts.ip and not opts.bridge:
|
|
630 |
if not (opts.mem or opts.vcpus or opts.ip or opts.bridge or opts.mac):
|
|
630 | 631 |
logger.ToStdout("Please give at least one of the parameters.") |
631 | 632 |
return 1 |
632 | 633 |
|
633 | 634 |
op = opcodes.OpSetInstanceParms(instance_name=args[0], mem=opts.mem, |
634 | 635 |
vcpus=opts.vcpus, ip=opts.ip, |
635 |
bridge=opts.bridge) |
|
636 |
bridge=opts.bridge, mac=opts.mac)
|
|
636 | 637 |
result = SubmitOpCode(op) |
637 | 638 |
|
638 | 639 |
if result: |
... | ... | |
701 | 702 |
make_option("-i", "--ip", dest="ip", |
702 | 703 |
help="IP address ('none' [default], 'auto', or specify address)", |
703 | 704 |
default='none', type="string", metavar="<ADDRESS>"), |
705 |
make_option("--mac", dest="mac", |
|
706 |
help="MAC address ('auto' [default], or specify address)", |
|
707 |
default='auto', type="string", metavar="<MACADDRESS>"), |
|
704 | 708 |
make_option("--no-wait-for-sync", dest="wait_for_sync", default=True, |
705 | 709 |
action="store_false", help="Don't wait for sync (DANGEROUS!)"), |
706 | 710 |
make_option("-b", "--bridge", dest="bridge", |
... | ... | |
808 | 812 |
make_option("-b", "--bridge", dest="bridge", |
809 | 813 |
help="Bridge to connect this instance to", |
810 | 814 |
default=None, type="string", metavar="<bridge>"), |
815 |
make_option("--mac", dest="mac", |
|
816 |
help="MAC address", default=None, |
|
817 |
type="string", metavar="<MACADDRESS>"), |
|
811 | 818 |
], |
812 | 819 |
"<instance>", "Alters the parameters of an instance"), |
813 | 820 |
'shutdown': (ShutdownInstance, ARGS_ANY, |
Also available in: Unified diff