mirror of https://github.com/apache/cloudstack.git
Create global configuration to allow changing the default nic adapter for user VMs in VMware (#7954)
Co-authored-by: Gabriel <gabriel.fernandes@scclouds.com.br>
This commit is contained in:
parent
1f29f6f040
commit
be4a648f5a
|
|
@ -129,15 +129,15 @@ class VmwareVmImplementer {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
// for user-VM, use E1000 as default
|
||||
if (nicDeviceType == null) {
|
||||
details.put(VmDetailConstants.NIC_ADAPTER, VirtualEthernetCardType.E1000.toString());
|
||||
details.put(VmDetailConstants.NIC_ADAPTER, vmwareMgr.VmwareUserVmNicDeviceType.value());
|
||||
} else {
|
||||
try {
|
||||
VirtualEthernetCardType.valueOf(nicDeviceType);
|
||||
} catch (Exception e) {
|
||||
LOGGER.warn("Invalid NIC device type " + nicDeviceType + " is specified in VM details, switch to default E1000");
|
||||
details.put(VmDetailConstants.NIC_ADAPTER, VirtualEthernetCardType.E1000.toString());
|
||||
LOGGER.warn(String.format("Invalid NIC device type [%s] specified in VM details, switching to value [%s] of configuration [%s].",
|
||||
nicDeviceType, vmwareMgr.VmwareUserVmNicDeviceType.value(), vmwareMgr.VmwareUserVmNicDeviceType.toString()));
|
||||
details.put(VmDetailConstants.NIC_ADAPTER, vmwareMgr.VmwareUserVmNicDeviceType.value());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,6 +53,14 @@ public interface VmwareManager {
|
|||
"VMware interval window (in seconds) to collect metrics. If this is set to less than 20, then default (300 seconds) will be used. The interval used must be enabled in vCenter for this change to work, "
|
||||
+ "otherwise the collection of metrics will result in an error. Check VMWare docs to know how to enable metrics interval.", true);
|
||||
|
||||
static final ConfigKey<String> VmwareUserVmNicDeviceType = new ConfigKey<String>(
|
||||
String.class,
|
||||
"vmware.uservm.nic.device.type",
|
||||
"Advanced",
|
||||
"E1000",
|
||||
"Specify the default network device type for user VMs, valid values are E1000, PCNet32, Vmxnet2, Vmxnet3",
|
||||
true, ConfigKey.Scope.Global, null, null, null, null, null, ConfigKey.Kind.Select, "E1000,PCNet32,Vmxnet2,Vmxnet3");
|
||||
|
||||
String composeWorkerName();
|
||||
|
||||
String getSystemVMIsoFileNameOnDatastore();
|
||||
|
|
|
|||
|
|
@ -296,7 +296,7 @@ public class VmwareManagerImpl extends ManagerBase implements VmwareManager, Vmw
|
|||
|
||||
@Override
|
||||
public ConfigKey<?>[] getConfigKeys() {
|
||||
return new ConfigKey<?>[] {s_vmwareNicHotplugWaitTimeout, s_vmwareCleanOldWorderVMs, templateCleanupInterval, s_vmwareSearchExcludeFolder, s_vmwareOVAPackageTimeout, s_vmwareCleanupPortGroups, VMWARE_STATS_TIME_WINDOW};
|
||||
return new ConfigKey<?>[] {s_vmwareNicHotplugWaitTimeout, s_vmwareCleanOldWorderVMs, templateCleanupInterval, s_vmwareSearchExcludeFolder, s_vmwareOVAPackageTimeout, s_vmwareCleanupPortGroups, VMWARE_STATS_TIME_WINDOW, VmwareUserVmNicDeviceType};
|
||||
}
|
||||
@Override
|
||||
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
|
||||
|
|
|
|||
Loading…
Reference in New Issue