diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java index eb9f9d5cec5..5a256dcf746 100755 --- a/server/src/com/cloud/storage/StorageManagerImpl.java +++ b/server/src/com/cloud/storage/StorageManagerImpl.java @@ -3239,7 +3239,8 @@ public class StorageManagerImpl implements StorageManager, Manager, ClusterManag if (s_logger.isDebugEnabled()) { s_logger.debug("Mismatch in storage pool " + assignedPool + " assigned by deploymentPlanner and the one associated with volume " + vol); } - if (vm.getServiceOffering().getUseLocalStorage()) + DiskOfferingVO diskOffering = _diskOfferingDao.findById(vol.getDiskOfferingId()); + if (diskOffering.getUseLocalStorage()) { if (s_logger.isDebugEnabled()) { s_logger.debug("Local volume " + vol + " will be recreated on storage pool " + assignedPool + " assigned by deploymentPlanner"); @@ -3250,10 +3251,12 @@ public class StorageManagerImpl implements StorageManager, Manager, ClusterManag s_logger.debug("Shared volume " + vol + " will be migrated on storage pool " + assignedPool + " assigned by deploymentPlanner"); } try { - Volume migratedVol = migrateVolume(vol.getId(), assignedPool.getId()); - vm.addDisk(new VolumeTO(migratedVol, assignedPool)); + List volumesToMigrate = new ArrayList(); + volumesToMigrate.add(vol); + migrateVolumes(volumesToMigrate, assignedPool); + vm.addDisk(new VolumeTO(vol, assignedPool)); } catch (ConcurrentOperationException e) { - throw new StorageUnavailableException("Volume migration failed for " + vol, Volume.class, vol.getId()); + throw new CloudRuntimeException("Migration of volume " + vol + " to storage pool " + assignedPool + " failed", e); } } } else { diff --git a/setup/db/db/schema-303to40.sql b/setup/db/db/schema-303to40.sql index a44e64ea4c9..9f249661a19 100644 --- a/setup/db/db/schema-303to40.sql +++ b/setup/db/db/schema-303to40.sql @@ -81,8 +81,6 @@ AlTER TABLE physical_network_service_providers ADD CONSTRAINT `fk_pnetwork_servi UPDATE `cloud`.`configuration` SET description='In second, timeout for creating volume from snapshot' WHERE name='create.volume.from.snapshot.wait'; ALTER TABLE `cloud`.`hypervisor_capabilities` ADD COLUMN `max_data_volumes_limit` int unsigned DEFAULT 6 COMMENT 'Max. data volumes per VM supported by hypervisor'; -SET SQL_SAFE_UPDATES=0; UPDATE `cloud`.`hypervisor_capabilities` SET `max_data_volumes_limit`=13 WHERE `hypervisor_type`='XenServer' AND (`hypervisor_version`='6.0' OR `hypervisor_version`='6.0.2'); -SET SQL_SAFE_UPDATES=1; INSERT INTO `cloud`.`configuration` (`category`, `instance`, `component`, `name`, `value`, `description`) VALUES ('Advanced', 'DEFAULT', 'management-server', 'event.purge.interval', '86400', 'The interval (in seconds) to wait before running the event purge thread'); UPDATE `cloud`.`configuration` SET description='Do URL encoding for the api response, false by default' WHERE name='encode.api.response';