cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From devd...@apache.org
Subject [1/3] git commit: updated refs/heads/master to 3de6cdb
Date Wed, 07 Aug 2013 11:55:11 GMT
Updated Branches:
  refs/heads/master 78d344b84 -> 3de6cdb4f


CLOUDSTACK-4104: VM Creation should fail if a zone is dedicated to a domain and user of the
same domain deploys vm without using affinity group "Explicit Dedication".


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/61c7aa7a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/61c7aa7a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/61c7aa7a

Branch: refs/heads/master
Commit: 61c7aa7afea078239146c8957f49e8ea07ebd5db
Parents: 78d344b
Author: Saksham Srivastava <saksham.srivastava@citrix.com>
Authored: Wed Aug 7 16:52:50 2013 +0530
Committer: Devdeep Singh <devdeep@gmail.com>
Committed: Wed Aug 7 17:15:12 2013 +0530

----------------------------------------------------------------------
 .../deploy/DeploymentPlanningManagerImpl.java   | 20 ++------------------
 1 file changed, 2 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/61c7aa7a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
index 5336d30..25c6634 100644
--- a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
+++ b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
@@ -462,24 +462,8 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements
Deploy
         if (!isExplicit && vm.getType() == VirtualMachine.Type.User) {
             //add explicitly dedicated resources in avoidList
             DedicatedResourceVO dedicatedZone = _dedicatedDao.findByZoneId(dc.getId());
-            if (dedicatedZone != null) {
-                long accountDomainId = vmProfile.getOwner().getDomainId();
-                long accountId = vmProfile.getOwner().getAccountId();
-                if (dedicatedZone.getDomainId() != null && !dedicatedZone.getDomainId().equals(accountDomainId))
{
-                    throw new CloudRuntimeException("Failed to deploy VM. Zone " + dc.getName()
+ " is dedicated.");
-                }
-
-                // If a zone is dedicated to an account then all hosts in this zone will
be explicitly dedicated to
-                // that account. So there won't be any shared hosts in the zone, the only
way to deploy vms from that
-                // account will be to use explicit dedication affinity group.
-                if (dedicatedZone.getAccountId() != null) {
-                    if (dedicatedZone.getAccountId().equals(accountId)) {
-                        throw new CloudRuntimeException("Failed to deploy VM. There are no
shared hosts available in" +
-                                " this dedicated zone.");
-                    } else {
-                        throw new CloudRuntimeException("Failed to deploy VM. Zone " + dc.getName()
+ " is dedicated.");
-                    }
-                }
+            if (dedicatedZone != null && dedicatedZone.getDomainId() != null) {
+                throw new CloudRuntimeException("Failed to deploy VM. Zone " + dc.getName()
+ " is dedicated . Please use Explicit Dedication Affinity Group");
             }
 
             List<HostPodVO> podsInDc = _podDao.listByDataCenterId(dc.getId());


Mime
View raw message