Skip to content

Commit b25ee92

Browse files
CS-5950: Wrong storage tags are used for ISO deployed VMs.
1 parent 49a29ce commit b25ee92

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.cloud.deploy;
1818

1919
import java.util.ArrayList;
20+
import java.util.Arrays;
2021
import java.util.Comparator;
2122
import java.util.HashMap;
2223
import java.util.HashSet;
@@ -91,6 +92,7 @@
9192
import com.cloud.resource.ResourceState;
9293
import com.cloud.storage.DiskOfferingVO;
9394
import com.cloud.storage.ScopeType;
95+
import com.cloud.storage.Storage;
9496
import com.cloud.storage.StorageManager;
9597
import com.cloud.storage.StoragePool;
9698
import com.cloud.storage.StoragePoolHostVO;
@@ -1202,8 +1204,12 @@ protected Pair<Map<Volume, List<StoragePool>>, List<Volume>> findSuitablePoolsFo
12021204
s_logger.debug("Calling StoragePoolAllocators to find suitable pools");
12031205

12041206
DiskOfferingVO diskOffering = _diskOfferingDao.findById(toBeCreated.getDiskOfferingId());
1205-
DiskProfile diskProfile = new DiskProfile(toBeCreated, diskOffering, vmProfile.getHypervisorType());
12061207

1208+
if (vmProfile.getTemplate().getFormat() == Storage.ImageFormat.ISO && vmProfile.getServiceOffering().getTagsArray().length != 0) {
1209+
diskOffering.setTagsArray(Arrays.asList(vmProfile.getServiceOffering().getTagsArray()));
1210+
}
1211+
1212+
DiskProfile diskProfile = new DiskProfile(toBeCreated, diskOffering, vmProfile.getHypervisorType());
12071213
boolean useLocalStorage = false;
12081214
if (vmProfile.getType() != VirtualMachine.Type.User) {
12091215
String ssvmUseLocalStorage = _configDao.getValue(Config.SystemVMUseLocalStorage.key());

0 commit comments

Comments
 (0)