Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@

--;
-- Schema upgrade from 4.11.0.0 to 4.11.1.0
--;
--;

DELETE FROM `cloud`.`configuration` WHERE `name`='vmware.ports.per.dvportgroup';
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ public class VmwareManagerImpl extends ManagerBase implements VmwareManager, Vmw
private static final Logger s_logger = Logger.getLogger(VmwareManagerImpl.class);

private static final long SECONDS_PER_MINUTE = 60;
private static final int DEFAULT_PORTS_PER_DV_PORT_GROUP_VSPHERE4_x = 256;
private static final int DEFAULT_PORTS_PER_DV_PORT_GROUP = 8;

private int _timeout;

Expand Down Expand Up @@ -194,7 +196,7 @@ public class VmwareManagerImpl extends ManagerBase implements VmwareManager, Vmw
private StorageLayer _storage;
private final String _privateNetworkVSwitchName = "vSwitch0";

private int _portsPerDvPortGroup = 256;
private int _portsPerDvPortGroup = DEFAULT_PORTS_PER_DV_PORT_GROUP;
private boolean _fullCloneFlag;
private boolean _instanceNameFlag;
private String _serviceConsoleName;
Expand Down Expand Up @@ -279,8 +281,6 @@ public boolean configure(String name, Map<String, Object> params) throws Configu
_instanceNameFlag = Boolean.parseBoolean(value);
}

_portsPerDvPortGroup = NumbersUtil.parseInt(_configDao.getValue(Config.VmwarePortsPerDVPortGroup.key()), _portsPerDvPortGroup);

_serviceConsoleName = _configDao.getValue(Config.VmwareServiceConsole.key());
if (_serviceConsoleName == null) {
_serviceConsoleName = "Service Console";
Expand Down Expand Up @@ -394,8 +394,16 @@ private void prepareHost(HostMO hostMo, String privateTrafficLabel) throws Excep
HypervisorHostHelper.prepareNetwork(vSwitchName, "cloud.private", hostMo, vlanId, null, null, 180000, false, BroadcastDomainType.Vlan, null, null);
}
else {
int portsPerDvPortGroup = _portsPerDvPortGroup;
AboutInfo about = hostMo.getHostAboutInfo();
if (about != null) {
String version = about.getApiVersion();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the versions fixed? I mean, can't we have 4.2, 4.3, and so on.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rafaelweingartner No VMware ESXi/ESX hosts with these release versions. Take a look at the versions in the article https://kb.vmware.com/s/article/2143832.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

if (version != null && (version.equals("4.0") || version.equals("4.1")) && _portsPerDvPortGroup < DEFAULT_PORTS_PER_DV_PORT_GROUP_VSPHERE4_x) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you need that second condition there _portsPerDvPortGroup < DEFAULT_PORTS_PER_DV_PORT_GROUP_VSPHERE4_x?

@sureshanaparti sureshanaparti May 10, 2018 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rafaelweingartner Yes. For these versions, the default ports which is 256 shouldn't change, for the backward compatibility. The below details can be documented in the upgrade details.

In case of vSphere 4.1/4.0 (If used), as this feature is not there, the new default value (=> 8) have an impact in the existing deployments. Action item for vSphere 4.1/4.0: Admin should modify the global configuration setting "vmware.ports.per.dvportgroup" from 8 to any number based on their environment because the proposal default value of 8 would be very less without auto expand feature in general. The current default value of 256 may not need immediate modification after deployment, but 8 would be very less which means admin need to update immediately after upgrade.

portsPerDvPortGroup = DEFAULT_PORTS_PER_DV_PORT_GROUP_VSPHERE4_x;
}
}
HypervisorHostHelper.prepareNetwork(vSwitchName, "cloud.private", hostMo, vlanId, null, null, null, 180000,
vsType, _portsPerDvPortGroup, null, false, BroadcastDomainType.Vlan, null, null);
vsType, portsPerDvPortGroup, null, false, BroadcastDomainType.Vlan, null, null);
}
}

Expand Down
8 changes: 0 additions & 8 deletions server/src/com/cloud/configuration/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -1139,14 +1139,6 @@ public enum Config {
"false",
"Enable/Disable Nexus/Vmware dvSwitch in VMware environment",
null),
VmwarePortsPerDVPortGroup(
"Network",
ManagementServer.class,
Integer.class,
"vmware.ports.per.dvportgroup",
"256",
"Default number of ports per Vmware dvPortGroup in VMware environment",
null),
VmwareCreateFullClone(
"Advanced",
ManagementServer.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -755,16 +755,16 @@ private static void createPortGroup(String physicalNetwork, String networkName,
dvsPortSetting = createVmwareDVPortSettingSpec(shapingPolicy, secPolicy, pvlanSpec);
}

newDvPortGroupSpec = createDvPortGroupSpec(networkName, dvsPortSetting, numPorts, autoExpandSupported);
if (portGroupPolicy != null)
{
newDvPortGroupSpec = createDvPortGroupSpec(networkName, dvsPortSetting, autoExpandSupported);
if (portGroupPolicy != null) {
newDvPortGroupSpec.setPolicy(portGroupPolicy);
}

if (!dataCenterMo.hasDvPortGroup(networkName)) {
s_logger.info("Distributed Virtual Port group " + networkName + " not found.");
// TODO(sateesh): Handle Exceptions
try {
newDvPortGroupSpec.setNumPorts(numPorts);
dvSwitchMo.createDVPortGroup(newDvPortGroupSpec);
} catch (Exception e) {
String msg = "Failed to create distributed virtual port group " + networkName + " on dvSwitch " + physicalNetwork;
Expand Down Expand Up @@ -994,13 +994,12 @@ public static boolean isSpecMatch(DVPortgroupConfigInfo configInfo, Integer vid,
return true;
}

public static DVPortgroupConfigSpec createDvPortGroupSpec(String dvPortGroupName, DVPortSetting portSetting, int numPorts, boolean autoExpandSupported) {
public static DVPortgroupConfigSpec createDvPortGroupSpec(String dvPortGroupName, DVPortSetting portSetting, boolean autoExpandSupported) {
DVPortgroupConfigSpec spec = new DVPortgroupConfigSpec();
spec.setName(dvPortGroupName);
spec.setDefaultPortConfig(portSetting);
spec.setPortNameFormat("vnic<portIndex>");
spec.setType("earlyBinding");
spec.setNumPorts(numPorts);
spec.setAutoExpand(autoExpandSupported);
return spec;
}
Expand Down