Commit e0e31530 authored by Iustin Pop's avatar Iustin Pop
Browse files

Allow network-less instances

Currently there's no way to specify no NICs for an instance, even though
this is a supported configuration.

The patch adds a --no-nics option to gnt-instance add.

Reviewed-by: amishchenko
parent 9d5ba39a
......@@ -302,6 +302,9 @@ def AddInstance(opts, args):
for nidx, ndict in opts.nics.items():
nidx = int(nidx)
nics[nidx] = ndict
elif opts.no_nics:
# no nics
nics = []
# default of one nic, all auto
nics = [{}]
......@@ -1145,6 +1148,8 @@ add_opts = [
default=[], dest="nics",
make_option("--no-nics", default=False, action="store_true",
help="Do not create any network cards for the instance"),
make_option("--no-wait-for-sync", dest="wait_for_sync", default=True,
action="store_false", help="Don't wait for sync (DANGEROUS!)"),
make_option("--no-start", dest="start", default=True,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment