mirror of https://github.com/apache/cloudstack.git
bug 6838: during vm creation, the volume's device id wasn't set leading to npe during attaching a new vol to the vm (it checks for device ids)
status 6838: resolved fixed
This commit is contained in:
parent
01b4af3006
commit
bf987c57d9
|
|
@ -2658,6 +2658,11 @@ public class StorageManagerImpl implements StorageManager, StorageService, Manag
|
|||
vol.setInstanceId(vm.getId());
|
||||
}
|
||||
|
||||
if(type.equals(VolumeType.ROOT))
|
||||
vol.setDeviceId(0l);
|
||||
else
|
||||
vol.setDeviceId(1l);
|
||||
|
||||
vol = _volsDao.persist(vol);
|
||||
|
||||
return toDiskProfile(vol, offering);
|
||||
|
|
@ -2684,6 +2689,11 @@ public class StorageManagerImpl implements StorageManager, StorageService, Manag
|
|||
}
|
||||
vol.setTemplateId(template.getId());
|
||||
|
||||
if(type.equals(VolumeType.ROOT))
|
||||
vol.setDeviceId(0l);
|
||||
else
|
||||
vol.setDeviceId(1l);
|
||||
|
||||
vol = _volsDao.persist(vol);
|
||||
|
||||
return toDiskProfile(vol, offering);
|
||||
|
|
|
|||
Loading…
Reference in New Issue