diff --git a/server/src/com/cloud/network/vpc/VpcManagerImpl.java b/server/src/com/cloud/network/vpc/VpcManagerImpl.java index f4c47ed9c49..d24009ddbe8 100644 --- a/server/src/com/cloud/network/vpc/VpcManagerImpl.java +++ b/server/src/com/cloud/network/vpc/VpcManagerImpl.java @@ -528,8 +528,9 @@ public class VpcManagerImpl implements VpcManager, Manager{ // Validate vpc offering VpcOfferingVO vpcOff = _vpcOffDao.findById(vpcOffId); - if (vpcOff == null) { - InvalidParameterValueException ex = new InvalidParameterValueException("Unable to find vpc offering by specified id"); + if (vpcOff == null || vpcOff.getState() != State.Enabled) { + InvalidParameterValueException ex = new InvalidParameterValueException("Unable to find vpc offering in " + State.Enabled + + " state by specified id"); ex.addProxyObject("vpc_offerings", vpcOffId, "vpcOfferingId"); throw ex; }