Github user sureshanaparti commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1953#discussion_r102301645
  
    --- Diff: server/src/com/cloud/storage/VolumeApiServiceImpl.java ---
    @@ -2639,22 +2639,23 @@ private int getMaxDataVolumesSupported(UserVmVO vm) 
{
             return maxDataVolumesSupported.intValue();
         }
     
    -    private Long getDeviceId(long vmId, Long deviceId) {
    +    private Long getDeviceId(UserVmVO vm, Long deviceId) {
             // allocate deviceId
    -        List<VolumeVO> vols = _volsDao.findByInstance(vmId);
    +        int maxDataVolumesSupported = getMaxDataVolumesSupported(vm);
    --- End diff --
    
    @HrWiggles Thanks for the review. The max data volumes here is the actual 
hypervisor capability (which is posted in the db). The device id 3 is being 
reserved for something since long and I don't want that to be effected.
    When _getMaxDataVolumesSupported()_ returns 6, max 5 volumes can be 
attached to the VM and one device reserved (might be for virtual tools/CDROM). 
_maxDataVolumesSupported_ specifies the data volumes limit supported by 
hypervisor, nothing related to _maxDeviceId_.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to