mib1185 edited a comment on issue #3718:
URL: https://github.com/apache/cloudstack/issues/3718#issuecomment-752084899


   Hi,
   
   during setup of cloudstack, table `hypervisor_capabilities` is created by
   
   
https://github.com/apache/cloudstack/blob/3a326f7280fefcd809573149ceb05b5fc7d07893/setup/db/create-schema.sql#L1657
   
   with "default" entry for `KVM`
   
   
https://github.com/apache/cloudstack/blob/3a326f7280fefcd809573149ceb05b5fc7d07893/setup/db/create-schema.sql#L1681
   
   which results in `max_data_volumes_limit` for "kvm default" is set to 6  by
   
   
https://github.com/apache/cloudstack/blob/3a326f7280fefcd809573149ceb05b5fc7d07893/setup/db/create-schema.sql#L1664
   
   
   ---
   
   
   Now in case of creating an instance in state `stopped` it is never started 
and therefor `vm.getLastHostId()` returns NULL in
   
   
https://github.com/apache/cloudstack/blob/3a326f7280fefcd809573149ceb05b5fc7d07893/server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java#L3252
   
   and "fallback if no proper configuration is found" is triggered, which grabs 
the `max_data_volumes_limit` value for "default" hypervisor version (_which was 
set to 6 during setup_)
   
   
https://github.com/apache/cloudstack/blob/3a326f7280fefcd809573149ceb05b5fc7d07893/server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java#L3266
   
   
   ---
   
   
   But once the instance is deployed, `vm.getLastHostId()` will return a valid 
hostId, which results in respecting the real hypervisor version at
   
https://github.com/apache/cloudstack/blob/3a326f7280fefcd809573149ceb05b5fc7d07893/server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java#L3262
   
   
   ---
   
   
   During `Schema upgrade from 4.5.1 to 4.6.0` the `max_data_volumes_limit` is 
set to `32` for KVM
   
https://github.com/apache/cloudstack/blob/3a326f7280fefcd809573149ceb05b5fc7d07893/engine/schema/src/main/resources/META-INF/db/schema-452to460.sql#L421
   
   This will only be processed during update to 4.6, but I assume not during 
fresh install of 4.6 or later?! 🤔 
   Therefor I would recommend to also set `max_data_volumes_limit` to `32` 
during setup of database
   
   
   
   regards,
   Michael


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to