Don't send public/guest nic info when start VR in VPC
Conflicts:
server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit:
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/214782cc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/214782cc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/214782cc
Branch: refs/heads/vpc
Commit: 214782cc8ca643fa099f5651d31e60e7f7c0879f
Parents: 03fe667
Author: Alena Prokharchyk <[email protected]>
Authored: Mon Jun 18 15:30:20 2012 -0700
Committer: Alena Prokharchyk <[email protected]>
Committed: Tue Jun 19 10:05:06 2012 -0700
----------------------------------------------------------------------
.../router/VirtualNetworkApplianceManagerImpl.java | 2 +-
.../VpcVirtualNetworkApplianceManagerImpl.java | 38 ++++++++-------
2 files changed, 21 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/214782cc/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git
a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
index 4715853..93211c7 100755
---
a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++
b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -1683,7 +1683,7 @@ public class VirtualNetworkApplianceManagerImpl
implements VirtualNetworkApplian
publicNetwork = true;
}
}
-
+
if (controlNic == null) {
throw new CloudRuntimeException("Didn't start a control port");
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/214782cc/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git
a/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
index bc7d3e0..899faf7 100644
---
a/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
+++
b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
@@ -15,6 +15,7 @@ package com.cloud.network.router;
import java.net.URI;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -363,8 +364,6 @@ public class VpcVirtualNetworkApplianceManagerImpl extends
VirtualNetworkApplian
public boolean finalizeStart(VirtualMachineProfile<DomainRouterVO>
profile, long hostId, Commands cmds,
ReservationContext context) {
-
-
if (!super.finalizeStart(profile, hostId, cmds, context)) {
return false;
} else if (profile.getVirtualMachine().getVpcId() == null) {
@@ -686,20 +685,23 @@ public class VpcVirtualNetworkApplianceManagerImpl
extends VirtualNetworkApplian
}
-// @Override
-// public boolean
finalizeVirtualMachineProfile(VirtualMachineProfile<DomainRouterVO> profile,
DeployDestination dest,
-// ReservationContext context) {
-// //remove public and guest nics as we will plug them later
-// Iterator<NicProfile> it = profile.getNics().iterator();
-// while (it.hasNext()) {
-// NicProfile nic = it.next();
-// if (nic.getTrafficType() == TrafficType.Public ||
nic.getTrafficType() == TrafficType.Guest) {
-// s_logger.debug("Removing nic of type " +
nic.getTrafficType() + " from the nics passed on vm start. " +
-// "The nic will be plugged later");
-// it.remove();
-// }
-// }
-//
-// return super.finalizeVirtualMachineProfile(profile, dest, context);
-// }
+ @Override
+ public boolean
finalizeVirtualMachineProfile(VirtualMachineProfile<DomainRouterVO> profile,
DeployDestination dest,
+ ReservationContext context) {
+
+ if (profile.getVirtualMachine().getVpcId() != null) {
+ //remove public and guest nics as we will plug them later
+ Iterator<NicProfile> it = profile.getNics().iterator();
+ while (it.hasNext()) {
+ NicProfile nic = it.next();
+ if (nic.getTrafficType() == TrafficType.Public ||
nic.getTrafficType() == TrafficType.Guest) {
+ s_logger.debug("Removing nic of type " +
nic.getTrafficType() + " from the nics passed on vm start. " +
+ "The nic will be plugged later");
+ it.remove();
+ }
+ }
+ }
+
+ return super.finalizeVirtualMachineProfile(profile, dest, context);
+ }
}