Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/4.19'
Browse files Browse the repository at this point in the history
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
  • Loading branch information
rohityadavcloud committed Jul 10, 2024
2 parents 9f1577d + 32cc1d4 commit cea4801
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
import com.cloud.storage.DataStoreRole;
import com.cloud.storage.DiskOfferingVO;
import com.cloud.storage.MigrationOptions;
import com.cloud.storage.ScopeType;
import com.cloud.storage.Snapshot;
import com.cloud.storage.SnapshotVO;
import com.cloud.storage.Storage;
Expand Down Expand Up @@ -922,11 +923,17 @@ private HostVO getHostOnWhichToExecuteMigrationCommand(VolumeInfo srcVolumeInfo,

HostVO hostVO;

if (srcStoragePoolVO.getClusterId() != null) {
hostVO = getHostInCluster(srcStoragePoolVO.getClusterId());
}
else {
hostVO = getHost(destVolumeInfo.getDataCenterId(), HypervisorType.KVM, false);
// if either source or destination is a HOST-scoped storage pool, the migration MUST be performed on that host
if (ScopeType.HOST.equals(srcVolumeInfo.getDataStore().getScope().getScopeType())) {
hostVO = _hostDao.findById(srcVolumeInfo.getDataStore().getScope().getScopeId());
} else if (ScopeType.HOST.equals(destVolumeInfo.getDataStore().getScope().getScopeType())) {
hostVO = _hostDao.findById(destVolumeInfo.getDataStore().getScope().getScopeId());
} else {
if (srcStoragePoolVO.getClusterId() != null) {
hostVO = getHostInCluster(srcStoragePoolVO.getClusterId());
} else {
hostVO = getHost(destVolumeInfo.getDataCenterId(), HypervisorType.KVM, false);
}
}

return hostVO;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,8 @@ public void updateCapacityForHost(final Host host, final Map<Long, ServiceOfferi
if (vmDetailCpu != null) {
//if vmDetail_cpu is not null it means it is running in a overcommited cluster.
cpuOvercommitRatio = Float.parseFloat(vmDetailCpu.getValue());
}
if (vmDetailRam != null) {
ramOvercommitRatio = Float.parseFloat(vmDetailRam.getValue());
}
ServiceOffering so = offeringsMap.get(vm.getServiceOfferingId());
Expand Down
2 changes: 1 addition & 1 deletion tools/appliance/systemvmtemplate/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"headless": true,
"http_directory": "http",
"iso_checksum": "sha512:33c08e56c83d13007e4a5511b9bf2c4926c4aa12fd5dd56d493c0653aecbab380988c5bf1671dbaea75c582827797d98c4a611f7fb2b131fbde2c677d5258ec9",
"iso_url": "https://download.cloudstack.org/systemvm/debian/debian-12.5.0-amd64-netinst.iso",
"iso_url": "https://cdimage.debian.org/mirror/cdimage/archive/12.5.0/amd64/iso-cd/debian-12.5.0-amd64-netinst.iso",
"net_device": "virtio-net",
"output_directory": "../dist",
"qemuargs": [
Expand Down

0 comments on commit cea4801

Please sign in to comment.