mirror of https://github.com/apache/cloudstack.git
added support to run hyperv agent on 0.0.0.0 and startuprouting command will discover the ip details and send in response
This commit is contained in:
parent
60c180086e
commit
26020fc078
|
|
@ -24,7 +24,7 @@
|
|||
<value>8</value>
|
||||
</setting>
|
||||
<setting name="private_ip_address" serializeAs="String">
|
||||
<value>10.1.1.1</value>
|
||||
<value>0.0.0.0</value>
|
||||
</setting>
|
||||
<setting name="type" serializeAs="String">
|
||||
<value>Routing</value>
|
||||
|
|
@ -45,13 +45,13 @@
|
|||
<value>34359738368</value>
|
||||
</setting>
|
||||
<setting name="host" serializeAs="String">
|
||||
<value>camldonall01.citrite.net</value>
|
||||
<value>0.0.0.0</value>
|
||||
</setting>
|
||||
<setting name="pod" serializeAs="String">
|
||||
<value>1</value>
|
||||
</setting>
|
||||
<setting name="gateway_ip_address" serializeAs="String">
|
||||
<value>10.70.176.1</value>
|
||||
<value>0.0.0.0</value>
|
||||
</setting>
|
||||
<setting name="cluster" serializeAs="String">
|
||||
<value>2</value>
|
||||
|
|
|
|||
|
|
@ -1609,13 +1609,19 @@ namespace HypervResource
|
|||
dynamic strtRouteCmd = cmdArray[0][CloudStackTypes.StartupRoutingCommand];
|
||||
|
||||
// Insert networking details
|
||||
strtRouteCmd.privateIpAddress = config.PrivateIpAddress;
|
||||
strtRouteCmd.privateNetmask = config.PrivateNetmask;
|
||||
strtRouteCmd.privateMacAddress = config.PrivateMacAddress;
|
||||
strtRouteCmd.storageIpAddress = config.PrivateIpAddress;
|
||||
strtRouteCmd.storageNetmask = config.PrivateNetmask;
|
||||
strtRouteCmd.storageMacAddress = config.PrivateMacAddress;
|
||||
strtRouteCmd.gatewayIpAddress = config.GatewayIpAddress;
|
||||
string privateIpAddress = strtRouteCmd.privateIpAddress;
|
||||
string subnet;
|
||||
System.Net.NetworkInformation.NetworkInterface privateNic = GetNicInfoFromIpAddress(privateIpAddress, out subnet);
|
||||
strtRouteCmd.privateIpAddress = privateIpAddress;
|
||||
strtRouteCmd.privateNetmask = subnet;
|
||||
strtRouteCmd.privateMacAddress = privateNic.GetPhysicalAddress().ToString();
|
||||
string storageip = strtRouteCmd.storageIpAddress;
|
||||
System.Net.NetworkInformation.NetworkInterface storageNic = GetNicInfoFromIpAddress(storageip, out subnet);
|
||||
|
||||
strtRouteCmd.storageIpAddress = storageip;
|
||||
strtRouteCmd.storageNetmask = subnet;
|
||||
strtRouteCmd.storageMacAddress = storageNic.GetPhysicalAddress().ToString();
|
||||
strtRouteCmd.gatewayIpAddress = storageNic.GetPhysicalAddress().ToString();
|
||||
strtRouteCmd.caps = "hvm";
|
||||
|
||||
// Detect CPUs, speed, memory
|
||||
|
|
@ -1696,9 +1702,11 @@ namespace HypervResource
|
|||
public static System.Net.NetworkInformation.NetworkInterface GetNicInfoFromIpAddress(string ipAddress, out string subnet)
|
||||
{
|
||||
System.Net.NetworkInformation.NetworkInterface[] nics = System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces();
|
||||
System.Net.NetworkInformation.NetworkInterface defaultnic = null;
|
||||
foreach (var nic in nics)
|
||||
{
|
||||
subnet = null;
|
||||
defaultnic = nic;
|
||||
// TODO: use to remove NETMASK and MAC from the config file, and to validate the IPAddress.
|
||||
var nicProps = nic.GetIPProperties();
|
||||
bool found = false;
|
||||
|
|
@ -1716,7 +1724,9 @@ namespace HypervResource
|
|||
}
|
||||
return nic;
|
||||
}
|
||||
throw new ArgumentException("No NIC for ipAddress " + ipAddress);
|
||||
var defaultSubnet = defaultnic.GetIPProperties().UnicastAddresses[0];
|
||||
subnet = defaultSubnet.IPv4Mask.ToString();
|
||||
return defaultnic;
|
||||
}
|
||||
|
||||
public static void GetCapacityForLocalPath(string localStoragePath, out long capacityBytes, out long availableBytes)
|
||||
|
|
|
|||
Loading…
Reference in New Issue