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:
abhishek 2010-12-07 14:59:04 -08:00
parent 01b4af3006
commit bf987c57d9
1 changed files with 10 additions and 0 deletions

View File

@ -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);