Copilot commented on code in PR #14073:
URL: https://github.com/apache/cloudstack/pull/14073#discussion_r4293848883
##########
engine/components-api/src/main/java/com/cloud/template/TemplateManager.java:
##########
@@ -148,6 +153,23 @@ public interface TemplateManager {
*/
void prepareIsoForVmProfile(VirtualMachineProfile profile,
DeployDestination dest);
+ /**
+ * Returns the device ids of the CD-ROM devices of the Instance, starting
from {@link #CDROM_PRIMARY_DEVICE_SEQ}.
+ * They cannot be used by the volumes of the Instance.
+ * An Instance has one CD-ROM device. If it uses config drive, the config
drive ISO is one more CD-ROM, which has the
+ * device id 4.
+ *
+ * @param vm the Instance
+ * @return the device ids of the CD-ROM devices, including the one of the
config drive ISO if the Instance uses config drive
+ */
+ Set<Long> getCdromDeviceIds(VirtualMachine vm);
Review Comment:
This new reservation contract is not applied to the initial deployment path:
`VirtualMachineManagerImpl.allocate` still assigns datadisk-template volumes
`diskNumber` values 1, 2, 3, ... directly. A config-drive VM with three such
data disks therefore still persists device 3 alongside the primary CD-ROM (and
device 4 for the fourth disk alongside the config-drive ISO), so the domain can
fail on its first start. Please use the same reserved-id allocation/validation
during initial deployment, not only for attach, restore, and import.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]