EduFrazao commented on code in PR #13603:
URL: https://github.com/apache/cloudstack/pull/13603#discussion_r3847448847
##########
core/src/main/java/com/cloud/resource/ServerResourceBase.java:
##########
@@ -106,8 +117,74 @@ protected void defineResourceNetworkInterfaces(Map<String,
Object> params) {
this.storageNic2 = NetUtils.getNetworkInterface(storageNic2);
}
+ private void checkForPrivateInterfaceDefinedByIp(Map<String, Object>
params) {
+ final String ifAddr = (String) params.get("private.network.address");
+ if (ifAddr != null) {
+ logger.debug(String.format("Trying to use private address to
resolve interface: [%s]", ifAddr));
+ try {
+ InetAddress rawAddr =
InetAddress.getByAddress(InetAddress.getByName(ifAddr).getAddress());
+ final NetworkInterface nic =
NetworkInterface.getByInetAddress(rawAddr);
+ if (nic != null) {
+ logger.info(String.format("Using NIC [%s] as private NIC.
Source: InterfaceAddress [%s]", nic, ifAddr));
+ privateNic = nic;
+ } else {
+ logger.info(String.format("Unable to found private NIC
with defined ip [%s]", ifAddr));
+ }
+ } catch (Throwable e) {
+ // Logging only, if this method was unable to find a valid
interface, iteration will be tested
+ logger.info(String.format("Unable to use private address to
get the management interface: [%s]", e.getMessage()));
+ }
Review Comment:
Unecessary change. The idea is really ignore those errors to follow the
previous behavior.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]