diff --git a/lib/cmdlib.py b/lib/cmdlib.py index e2374dbc66bca31bf45cd92eca1e575bd4595480..c1aa0630e68b1b1e7f75d127e45552385f38d8f5 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -3028,6 +3028,8 @@ class LUCreateInstance(LogicalUnit): if self.inst_ip is not None: nic.ip = self.inst_ip + network_port = None # placeholder assignment for later + disks = _GenerateDiskTemplate(self.cfg, self.op.disk_template, instance, pnode_name, @@ -3041,6 +3043,7 @@ class LUCreateInstance(LogicalUnit): nics=[nic], disks=disks, disk_template=self.op.disk_template, status=self.instance_status, + network_port=network_port, ) feedback_fn("* creating instance disks...") @@ -4001,6 +4004,7 @@ class LUQueryInstanceData(NoHooksLU): "memory": instance.memory, "nics": [(nic.mac, nic.ip, nic.bridge) for nic in instance.nics], "disks": disks, + "network_port": instance.network_port, "vcpus": instance.vcpus, } diff --git a/lib/constants.py b/lib/constants.py index fc5b8859667d8c33d6aecbbdce18f3239d07f1b6..6c65983427273c244acda196ba271bcc8a35aa03 100644 --- a/lib/constants.py +++ b/lib/constants.py @@ -25,7 +25,7 @@ from ganeti import _autoconf # various versions CONFIG_VERSION = 3 -PROTOCOL_VERSION = 8 +PROTOCOL_VERSION = 9 RELEASE_VERSION = _autoconf.PACKAGE_VERSION OS_API_VERSION = 5 EXPORT_VERSION = 0 diff --git a/lib/objects.py b/lib/objects.py index 507e43d55b97c3b8485a100cf4a447bb67042e92..0629529b060ff7b8bfc210b2ae86e2ae62cca49b 100644 --- a/lib/objects.py +++ b/lib/objects.py @@ -490,6 +490,7 @@ class Instance(TaggableObject): "nics", "disks", "disk_template", + "network_port", ] def _ComputeSecondaryNodes(self): diff --git a/scripts/gnt-instance b/scripts/gnt-instance index b4ce4caf506d701284742a5699606bd5b2ed2ea8..fd6f48d6a4af229ad4e8c22796c2a574f3ce123b 100755 --- a/scripts/gnt-instance +++ b/scripts/gnt-instance @@ -596,6 +596,7 @@ def ShowInstanceConfig(opts, args): buf.write(" - primary: %s\n" % instance["pnode"]) buf.write(" - secondaries: %s\n" % ", ".join(instance["snodes"])) buf.write(" Operating system: %s\n" % instance["os"]) + buf.write(" Allocated network port: %s\n" % instance["network_port"]) buf.write(" Hardware:\n") buf.write(" - VCPUs: %d\n" % instance["vcpus"]) buf.write(" - memory: %dMiB\n" % instance["memory"])