fix root volume attach

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
This commit is contained in:
Abhishek Kumar 2026-05-08 11:16:25 +05:30
parent b139d3726d
commit 08d2633b34
1 changed files with 1 additions and 2 deletions

View File

@ -1258,8 +1258,7 @@ public class ServerAdapter extends ManagerBase {
}
}
Long deviceId = null;
List<VolumeVO> volumes = volumeDao.findUsableVolumesForInstance(vmVo.getId());
if (CollectionUtils.isEmpty(volumes)) {
if (Volume.Type.ROOT.equals(volumeVO.getVolumeType())) {
deviceId = 0L;
}
Volume volume = volumeApiService.attachVolumeToVM(vmVo.getId(), volumeVO.getId(), deviceId, false);