real_disk = _OpenRealBD(disk)
result["DISK_%d_PATH" % idx] = real_disk.dev_path
result["DISK_%d_ACCESS" % idx] = disk.mode
+ result["DISK_%d_UUID" % idx] = disk.uuid
+ if disk.name:
+ result["DISK_%d_NAME" % idx] = disk.name
if constants.HV_DISK_TYPE in instance.hvparams:
result["DISK_%d_FRONTEND_TYPE" % idx] = \
instance.hvparams[constants.HV_DISK_TYPE]
# NICs
for idx, nic in enumerate(instance.nics):
result["NIC_%d_MAC" % idx] = nic.mac
+ result["NIC_%d_UUID" % idx] = nic.uuid
+ if nic.name:
+ result["NIC_%d_NAME" % idx] = nic.name
if nic.ip:
result["NIC_%d_IP" % idx] = nic.ip
result["NIC_%d_MODE" % idx] = nic.nicparams[constants.NIC_MODE]
vcpus=self.be_full[constants.BE_VCPUS],
nics=NICListToTuple(self, self.nics),
disk_template=self.op.disk_template,
- disks=[(d[constants.IDISK_NAME], d[constants.IDISK_SIZE],
- d[constants.IDISK_MODE]) for d in self.disks],
+ disks=[(d[constants.IDISK_NAME], d.get("uuid", ""),
+ d[constants.IDISK_SIZE], d[constants.IDISK_MODE])
+ for d in self.disks],
bep=self.be_full,
hvp=self.hv_full,
hypervisor_name=self.op.hypervisor,
}
if nics:
nic_count = len(nics)
- for idx, (name, _, ip, mac, mode, link, net, netinfo) in enumerate(nics):
+ for idx, (name, uuid, ip, mac, mode, link, net, netinfo) in enumerate(nics):
if ip is None:
ip = ""
- env["INSTANCE_NIC%d_NAME" % idx] = name
+ if name:
+ env["INSTANCE_NIC%d_NAME" % idx] = name
+ env["INSTANCE_NIC%d_UUID" % idx] = uuid
env["INSTANCE_NIC%d_IP" % idx] = ip
env["INSTANCE_NIC%d_MAC" % idx] = mac
env["INSTANCE_NIC%d_MODE" % idx] = mode
if disks:
disk_count = len(disks)
- for idx, (name, size, mode) in enumerate(disks):
- env["INSTANCE_DISK%d_NAME" % idx] = name
+ for idx, (name, uuid, size, mode) in enumerate(disks):
+ if name:
+ env["INSTANCE_DISK%d_NAME" % idx] = name
+ env["INSTANCE_DISK%d_UUID" % idx] = uuid
env["INSTANCE_DISK%d_SIZE" % idx] = size
env["INSTANCE_DISK%d_MODE" % idx] = mode
else:
"vcpus": bep[constants.BE_VCPUS],
"nics": NICListToTuple(lu, instance.nics),
"disk_template": instance.disk_template,
- "disks": [(disk.name, disk.size, disk.mode)
+ "disks": [(disk.name, disk.uuid, disk.size, disk.mode)
for disk in instance.disks],
"bep": bep,
"hvp": hvp,
This is how the hypervisor will export the instance disks: either
read-write (``rw``) or read-only (``ro``).
+DISK_%N_UUID
+ The uuid associated with the N-th disk of the instance.
+
+DISK_%N_NAME
+ (Optional) The name, if any, associated with the N-th disk of the instance.
+
DISK_%N_FRONTEND_TYPE
(Optional) If applicable to the current hypervisor type: the type
of the device exported by the hypervisor. For example, the Xen HVM
NIC_%N_MAC
The MAC address associated with this interface.
+NIC_%N_UUID
+ The uuid associated with the N-th NIC of the instance.
+
+NIC_%N_NAME
+ (Optional) The name, if any, associated with the N-th NIC of the instance.
+
NIC_%N_IP
The IP address, if any, associated with the N-th NIC of the
instance.