This is an automated email from the ASF dual-hosted git repository.
dahn pushed a commit to branch 4.17
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/4.17 by this push:
new 9fb20056d55 Fixed avoid set variables which is causing deployment
failures (#7372)
9fb20056d55 is described below
commit 9fb20056d552a5495c85e0aedd5cb23c84bcf452
Author: Harikrishna <[email protected]>
AuthorDate: Wed Mar 29 20:44:18 2023 +0530
Fixed avoid set variables which is causing deployment failures (#7372)
---
.../com/cloud/deploy/DeploymentPlanningManagerImpl.java | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git
a/server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java
b/server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java
index 1c3c59bcf30..d854b1a5a40 100644
--- a/server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java
+++ b/server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java
@@ -1576,11 +1576,11 @@ StateListener<State, VirtualMachine.Event,
VirtualMachine>, Configurable {
// for each volume find list of suitable storage pools by calling the
// allocators
- Set<Long> originalAvoidPoolSet = avoid.getPoolsToAvoid();
- if (originalAvoidPoolSet == null) {
- originalAvoidPoolSet = new HashSet<Long>();
+ Set<Long> originalAvoidPoolSet = new HashSet<>();
+ if (avoid.getPoolsToAvoid() != null) {
+ originalAvoidPoolSet.addAll(avoid.getPoolsToAvoid());
}
- Set<Long> poolsToAvoidOutput = new HashSet<Long>(originalAvoidPoolSet);
+ Set<Long> poolsToAvoidOutput = new HashSet<>(originalAvoidPoolSet);
for (VolumeVO toBeCreated : volumesTobeCreated) {
s_logger.debug("Checking suitable pools for volume (Id, Type): ("
+ toBeCreated.getId() + "," + toBeCreated.getVolumeType().name() + ")");
@@ -1657,12 +1657,6 @@ StateListener<State, VirtualMachine.Event,
VirtualMachine>, Configurable {
DiskOfferingVO diskOffering =
_diskOfferingDao.findById(toBeCreated.getDiskOfferingId());
- //FR123 check how is it different for service offering
getTagsArray and disk offering's
- //if ((vmProfile.getTemplate().getFormat() ==
Storage.ImageFormat.ISO || toBeCreated.getVolumeType() == Volume.Type.ROOT)
- // && vmProfile.getServiceOffering().getTagsArray().length
!= 0) {
- //
diskOffering.setTagsArray(Arrays.asList(vmProfile.getServiceOffering().getTagsArray()));
- //}
-
DiskProfile diskProfile = new DiskProfile(toBeCreated,
diskOffering, vmProfile.getHypervisorType());
boolean useLocalStorage = false;
if (vmProfile.getType() != VirtualMachine.Type.User) {