Add --storage-pool option to qvm-create
This commit is contained in:
parent
0bc0bc9045
commit
348030bf9c
@ -41,6 +41,8 @@ def main():
|
|||||||
help="Specify the label to use for the new VM (e.g. red, yellow, green, ...)")
|
help="Specify the label to use for the new VM (e.g. red, yellow, green, ...)")
|
||||||
parser.add_option ("-p", "--proxy", action="store_true", dest="proxyvm", default=False,
|
parser.add_option ("-p", "--proxy", action="store_true", dest="proxyvm", default=False,
|
||||||
help="Create ProxyVM")
|
help="Create ProxyVM")
|
||||||
|
parser.add_option ("-P", "--pool", dest="pool_name",
|
||||||
|
help="Specify which storage pool to use")
|
||||||
parser.add_option ("-H", "--hvm", action="store_true", dest="hvm", default=False,
|
parser.add_option ("-H", "--hvm", action="store_true", dest="hvm", default=False,
|
||||||
help="Create HVM (standalone unless --template option used)")
|
help="Create HVM (standalone unless --template option used)")
|
||||||
parser.add_option ("--hvm-template", action="store_true", dest="hvm_template", default=False,
|
parser.add_option ("--hvm-template", action="store_true", dest="hvm_template", default=False,
|
||||||
@ -71,6 +73,11 @@ def main():
|
|||||||
parser.error ("You must specify VM name!")
|
parser.error ("You must specify VM name!")
|
||||||
vmname = args[0]
|
vmname = args[0]
|
||||||
|
|
||||||
|
if options.pool_name is None:
|
||||||
|
pool_name = "default"
|
||||||
|
else :
|
||||||
|
pool_name = options.pool_name
|
||||||
|
|
||||||
if (options.netvm + options.proxyvm + options.hvm + options.hvm_template) > 1:
|
if (options.netvm + options.proxyvm + options.hvm + options.hvm_template) > 1:
|
||||||
parser.error ("You must specify at most one VM type switch")
|
parser.error ("You must specify at most one VM type switch")
|
||||||
|
|
||||||
@ -170,7 +177,9 @@ def main():
|
|||||||
vmtype = "QubesAppVm"
|
vmtype = "QubesAppVm"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
vm = qvm_collection.add_new_vm(vmtype, name=vmname, template=new_vm_template, label = label)
|
vm=qvm_collection.add_new_vm(vmtype, name=vmname,
|
||||||
|
template=new_vm_template, label=label,
|
||||||
|
pool_name=pool_name)
|
||||||
except QubesException as err:
|
except QubesException as err:
|
||||||
print >> sys.stderr, "ERROR: {0}".format(err)
|
print >> sys.stderr, "ERROR: {0}".format(err)
|
||||||
exit (1)
|
exit (1)
|
||||||
|
Loading…
Reference in New Issue
Block a user