Revision 8a348b15
b/lib/backend.py | ||
---|---|---|
2523 | 2523 |
real_disk = _OpenRealBD(disk) |
2524 | 2524 |
result["DISK_%d_PATH" % idx] = real_disk.dev_path |
2525 | 2525 |
result["DISK_%d_ACCESS" % idx] = disk.mode |
2526 |
result["DISK_%d_UUID" % idx] = disk.uuid |
|
2527 |
if disk.name: |
|
2528 |
result["DISK_%d_NAME" % idx] = disk.name |
|
2526 | 2529 |
if constants.HV_DISK_TYPE in instance.hvparams: |
2527 | 2530 |
result["DISK_%d_FRONTEND_TYPE" % idx] = \ |
2528 | 2531 |
instance.hvparams[constants.HV_DISK_TYPE] |
... | ... | |
2535 | 2538 |
# NICs |
2536 | 2539 |
for idx, nic in enumerate(instance.nics): |
2537 | 2540 |
result["NIC_%d_MAC" % idx] = nic.mac |
2541 |
result["NIC_%d_UUID" % idx] = nic.uuid |
|
2542 |
if nic.name: |
|
2543 |
result["NIC_%d_NAME" % idx] = nic.name |
|
2538 | 2544 |
if nic.ip: |
2539 | 2545 |
result["NIC_%d_IP" % idx] = nic.ip |
2540 | 2546 |
result["NIC_%d_MODE" % idx] = nic.nicparams[constants.NIC_MODE] |
b/lib/cmdlib/instance.py | ||
---|---|---|
620 | 620 |
vcpus=self.be_full[constants.BE_VCPUS], |
621 | 621 |
nics=NICListToTuple(self, self.nics), |
622 | 622 |
disk_template=self.op.disk_template, |
623 |
disks=[(d[constants.IDISK_NAME], d[constants.IDISK_SIZE], |
|
624 |
d[constants.IDISK_MODE]) for d in self.disks], |
|
623 |
disks=[(d[constants.IDISK_NAME], d.get("uuid", ""), |
|
624 |
d[constants.IDISK_SIZE], d[constants.IDISK_MODE]) |
|
625 |
for d in self.disks], |
|
625 | 626 |
bep=self.be_full, |
626 | 627 |
hvp=self.hv_full, |
627 | 628 |
hypervisor_name=self.op.hypervisor, |
b/lib/cmdlib/instance_utils.py | ||
---|---|---|
94 | 94 |
} |
95 | 95 |
if nics: |
96 | 96 |
nic_count = len(nics) |
97 |
for idx, (name, _, ip, mac, mode, link, net, netinfo) in enumerate(nics):
|
|
97 |
for idx, (name, uuid, ip, mac, mode, link, net, netinfo) in enumerate(nics):
|
|
98 | 98 |
if ip is None: |
99 | 99 |
ip = "" |
100 |
env["INSTANCE_NIC%d_NAME" % idx] = name |
|
100 |
if name: |
|
101 |
env["INSTANCE_NIC%d_NAME" % idx] = name |
|
102 |
env["INSTANCE_NIC%d_UUID" % idx] = uuid |
|
101 | 103 |
env["INSTANCE_NIC%d_IP" % idx] = ip |
102 | 104 |
env["INSTANCE_NIC%d_MAC" % idx] = mac |
103 | 105 |
env["INSTANCE_NIC%d_MODE" % idx] = mode |
... | ... | |
119 | 121 |
|
120 | 122 |
if disks: |
121 | 123 |
disk_count = len(disks) |
122 |
for idx, (name, size, mode) in enumerate(disks): |
|
123 |
env["INSTANCE_DISK%d_NAME" % idx] = name |
|
124 |
for idx, (name, uuid, size, mode) in enumerate(disks): |
|
125 |
if name: |
|
126 |
env["INSTANCE_DISK%d_NAME" % idx] = name |
|
127 |
env["INSTANCE_DISK%d_UUID" % idx] = uuid |
|
124 | 128 |
env["INSTANCE_DISK%d_SIZE" % idx] = size |
125 | 129 |
env["INSTANCE_DISK%d_MODE" % idx] = mode |
126 | 130 |
else: |
... | ... | |
169 | 173 |
"vcpus": bep[constants.BE_VCPUS], |
170 | 174 |
"nics": NICListToTuple(lu, instance.nics), |
171 | 175 |
"disk_template": instance.disk_template, |
172 |
"disks": [(disk.name, disk.size, disk.mode) |
|
176 |
"disks": [(disk.name, disk.uuid, disk.size, disk.mode)
|
|
173 | 177 |
for disk in instance.disks], |
174 | 178 |
"bep": bep, |
175 | 179 |
"hvp": hvp, |
b/man/ganeti-os-interface.rst | ||
---|---|---|
76 | 76 |
This is how the hypervisor will export the instance disks: either |
77 | 77 |
read-write (``rw``) or read-only (``ro``). |
78 | 78 |
|
79 |
DISK_%N_UUID |
|
80 |
The uuid associated with the N-th disk of the instance. |
|
81 |
|
|
82 |
DISK_%N_NAME |
|
83 |
(Optional) The name, if any, associated with the N-th disk of the instance. |
|
84 |
|
|
79 | 85 |
DISK_%N_FRONTEND_TYPE |
80 | 86 |
(Optional) If applicable to the current hypervisor type: the type |
81 | 87 |
of the device exported by the hypervisor. For example, the Xen HVM |
... | ... | |
96 | 102 |
NIC_%N_MAC |
97 | 103 |
The MAC address associated with this interface. |
98 | 104 |
|
105 |
NIC_%N_UUID |
|
106 |
The uuid associated with the N-th NIC of the instance. |
|
107 |
|
|
108 |
NIC_%N_NAME |
|
109 |
(Optional) The name, if any, associated with the N-th NIC of the instance. |
|
110 |
|
|
99 | 111 |
NIC_%N_IP |
100 | 112 |
The IP address, if any, associated with the N-th NIC of the |
101 | 113 |
instance. |
Also available in: Unified diff