New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLOUDSTACK-9403 : Support for shared networks in Nuage VSP plugin #1579
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -639,6 +639,7 @@ public class ApiConstants { | |
public static final String READ_ONLY = "readonly"; | ||
public static final String SUPPORTS_REGION_LEVEL_VPC = "supportsregionLevelvpc"; | ||
public static final String SUPPORTS_STRECHED_L2_SUBNET = "supportsstrechedl2subnet"; | ||
public static final String SUPPORTS_PUBLIC_ACCESS = "supportspublicaccess"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Guest VM's with public network access is possible by checking default egress rule. Without adding this new notion of a 'public access', networks can reuse the |
||
public static final String REGION_LEVEL_VPC = "regionlevelvpc"; | ||
public static final String STRECHED_L2_SUBNET = "strechedl2subnet"; | ||
public static final String NETWORK_SPANNED_ZONES = "zonesnetworkspans"; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,6 +120,10 @@ public class NetworkOfferingResponse extends BaseResponse { | |
@Param(description = "true if network offering supports network that span multiple zones", since = "4.4") | ||
private Boolean supportsStrechedL2Subnet; | ||
|
||
@SerializedName(ApiConstants.SUPPORTS_PUBLIC_ACCESS) | ||
@Param(description = "true if network offering supports public access for guest networks", since = "4.10.0") | ||
private Boolean supportsPublicAccess; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New networks can reuse the |
||
|
||
public void setId(String id) { | ||
this.id = id; | ||
} | ||
|
@@ -207,4 +211,8 @@ public void setConcurrentConnections(Integer concurrentConnections) { | |
public void setSupportsStrechedL2Subnet(Boolean supportsStrechedL2Subnet) { | ||
this.supportsStrechedL2Subnet = supportsStrechedL2Subnet; | ||
} | ||
|
||
public void setSupportsPublicAccess(Boolean supportsPublicAccess) { | ||
this.supportsPublicAccess = supportsPublicAccess; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -166,6 +166,11 @@ | |
<artifactId>cloud-plugin-network-vcs</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.cloudstack</groupId> | ||
<artifactId>cloud-plugin-network-vsp</artifactId> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are nuage specific dependencies Apache 2.0 license compliant and available on maven? Only then, I would be in a favour of moving the plugin to the default build profile. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, The dependency can be found here: http://cs.mv.nuagenetworks.net/releases/net/nuagenetworks/vsp/nuage-vsp-acs-client/1.0.0/ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for confirming @fmaximus |
||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.cloudstack</groupId> | ||
<artifactId>cloud-plugin-hypervisor-xenserver</artifactId> | ||
|
@@ -990,21 +995,6 @@ | |
</dependency> | ||
</dependencies> | ||
</profile> | ||
<profile> | ||
<id>nuagevsp</id> | ||
<activation> | ||
<property> | ||
<name>noredist</name> | ||
</property> | ||
</activation> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.apache.cloudstack</groupId> | ||
<artifactId>cloud-plugin-network-vsp</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
</dependencies> | ||
</profile> | ||
<profile> | ||
<id>srx</id> | ||
<activation> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,6 +142,9 @@ public class NetworkOfferingVO implements NetworkOffering { | |
@Column(name="supports_streched_l2") | ||
boolean supportsStrechedL2 = false; | ||
|
||
@Column(name="supports_public_access") | ||
boolean supportsPublicAccess = false; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we use egress_default_policy? Justify introduction of a new column? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In our SDN solution, shared networks are not always reachable. |
||
@Override | ||
public String getDisplayText() { | ||
return displayText; | ||
|
@@ -334,7 +337,7 @@ public NetworkOfferingVO(String name, String displayText, TrafficType trafficTyp | |
public NetworkOfferingVO(String name, String displayText, TrafficType trafficType, boolean systemOnly, boolean specifyVlan, Integer rateMbps, | ||
Integer multicastRateMbps, boolean isDefault, Availability availability, String tags, Network.GuestType guestType, boolean conserveMode, boolean dedicatedLb, | ||
boolean sharedSourceNat, boolean redundantRouter, boolean elasticIp, boolean elasticLb, boolean specifyIpRanges, boolean inline, boolean isPersistent, | ||
boolean associatePublicIP, boolean publicLb, boolean internalLb, boolean egressdefaultpolicy, boolean supportsStrechedL2) { | ||
boolean associatePublicIP, boolean publicLb, boolean internalLb, boolean egressdefaultpolicy, boolean supportsStrechedL2, boolean supportsPublicAccess) { | ||
this(name, | ||
displayText, | ||
trafficType, | ||
|
@@ -360,6 +363,7 @@ public NetworkOfferingVO(String name, String displayText, TrafficType trafficTyp | |
this.eipAssociatePublicIp = associatePublicIP; | ||
this.egressdefaultpolicy = egressdefaultpolicy; | ||
this.supportsStrechedL2 = supportsStrechedL2; | ||
this.supportsPublicAccess = supportsPublicAccess; | ||
} | ||
|
||
public NetworkOfferingVO() { | ||
|
@@ -495,4 +499,9 @@ public void setPublicLb(boolean publicLb) { | |
public boolean getSupportsStrechedL2() { | ||
return supportsStrechedL2; | ||
} | ||
|
||
@Override | ||
public boolean getSupportsPublicAccess() { | ||
return supportsPublicAccess; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// | ||
// Licensed to the Apache Software Foundation (ASF) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The ASF licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
// | ||
|
||
package com.cloud.agent.api.manager; | ||
|
||
import com.cloud.agent.api.Command; | ||
|
||
import com.google.common.base.Preconditions; | ||
import net.nuage.vsp.acs.client.api.model.VspDomainCleanUp; | ||
import org.apache.commons.lang.builder.HashCodeBuilder; | ||
|
||
import java.util.Objects; | ||
|
||
public class CleanUpDomainCommand extends Command { | ||
|
||
private final VspDomainCleanUp _domainCleanUp; | ||
|
||
public CleanUpDomainCommand(VspDomainCleanUp domainCleanUp) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it acceptable for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We added a null check (Preconditions.checkNotNull(domainCleanUp);). |
||
super(); | ||
Preconditions.checkNotNull(domainCleanUp); | ||
this._domainCleanUp = domainCleanUp; | ||
} | ||
|
||
public VspDomainCleanUp getDomainCleanUp() { | ||
return _domainCleanUp; | ||
} | ||
|
||
@Override | ||
public boolean executeInSequence() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
|
||
if (!(o instanceof CleanUpDomainCommand)) { | ||
return false; | ||
} | ||
|
||
CleanUpDomainCommand that = (CleanUpDomainCommand) o; | ||
|
||
return super.equals(that) | ||
&& Objects.equals(_domainCleanUp, that._domainCleanUp); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return new HashCodeBuilder() | ||
.appendSuper(super.hashCode()) | ||
.append(_domainCleanUp) | ||
.toHashCode(); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// | ||
// Licensed to the Apache Software Foundation (ASF) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The ASF licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
// | ||
|
||
package com.cloud.agent.api.manager; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This class appears to be Nuage specific. Why is is being added to core CloudStack and not the Nuage plugin? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This class is part of the plugin not core CS. |
||
|
||
import org.apache.commons.lang.builder.HashCodeBuilder; | ||
|
||
import java.util.Objects; | ||
|
||
import com.cloud.agent.api.Command; | ||
import com.cloud.network.resource.NuageVspResourceConfiguration; | ||
|
||
public class UpdateNuageVspDeviceCommand extends Command { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We added it. |
||
|
||
private final NuageVspResourceConfiguration configuration; | ||
|
||
public UpdateNuageVspDeviceCommand(NuageVspResourceConfiguration configuration) { | ||
super(); | ||
this.configuration = configuration; | ||
} | ||
|
||
public NuageVspResourceConfiguration getConfiguration() { | ||
return configuration; | ||
} | ||
|
||
@Override | ||
public boolean executeInSequence() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
|
||
if (!(o instanceof UpdateNuageVspDeviceCommand)) { | ||
return false; | ||
} | ||
|
||
UpdateNuageVspDeviceCommand that = (UpdateNuageVspDeviceCommand) o; | ||
|
||
return super.equals(that) | ||
&& Objects.equals(configuration, that.configuration); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return new HashCodeBuilder() | ||
.appendSuper(super.hashCode()) | ||
.append(configuration) | ||
.toHashCode(); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check if an untagged capability can be used, and default egress policy can be used; instead of introducing these two capabilities?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NoVlan is a Capability we're currently using when adding a new IP range to an existing shared network. Without this, the Broadcast URI would become vlan://untagged, while the shared network has a Broadcast URI of vsp://network-uuid. When the CIDR of the new ip range is the same as one of the already existing ip ranges, it would still not be allowed as the vlan id is different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for explaining @fmaximus