use of com.emc.storageos.db.client.model.IpInterface in project coprhd-controller by CoprHD.
the class IpInterfaceCompleter method complete.
@Override
protected void complete(DbClient dbClient, Status status, ServiceCoded coded) throws DeviceControllerException {
super.complete(dbClient, status, coded);
switch(status) {
case error:
dbClient.error(IpInterface.class, this.getId(), getOpId(), coded);
break;
default:
dbClient.ready(IpInterface.class, this.getId(), getOpId());
}
if (deactivateOnComplete && status.equals(Status.ready)) {
IpInterface ipinterface = dbClient.queryObject(IpInterface.class, this.getId());
dbClient.markForDeletion(ipinterface);
_logger.info("IpInterface marked for deletion: " + this.getId());
}
}
use of com.emc.storageos.db.client.model.IpInterface in project coprhd-controller by CoprHD.
the class AixHostDiscoveryAdapter method discoverIpInterfaces.
@Override
protected void discoverIpInterfaces(Host host, List<IpInterface> oldIpInterfaces) {
AixSystem aix = getCli(host);
for (IPInterface nic : aix.listIPInterfaces()) {
if (StringUtils.isNotBlank(nic.getIpAddress())) {
IpInterface ipInterface = getOrCreateIpInterface(oldIpInterfaces, nic.getIpAddress());
discoverIp4Interface(host, ipInterface, nic);
}
}
}
use of com.emc.storageos.db.client.model.IpInterface in project coprhd-controller by CoprHD.
the class EsxHostDiscoveryAdapter method discoverConnectedHostInitiators.
/**
* Discovers connected Host's Initiators and Ipinterfaces
*
* @param hostSystem
* - {@link HostSystem} VI SDK managedObject instance
* @param targetHost
* - {@link Host} being discovered.
* @param oldInitiators
* - old initiator list
* @param addedInitiators
* - new/added initiator list
*/
protected void discoverConnectedHostInitiators(HostSystem hostSystem, Host targetHost, List<Initiator> oldInitiators, List<Initiator> addedInitiators) {
// discover ipInterfaces
info(String.format("Discovering IP interfaces for %s", targetHost.forDisplay()));
List<IpInterface> oldIpInterfaces = new ArrayList<IpInterface>();
Iterables.addAll(oldIpInterfaces, getIpInterfaces(targetHost));
for (HostVirtualNic nic : getNics(hostSystem)) {
if (isIp6Interface(nic)) {
IpInterface ipInterface = getOrCreateIpInterface(oldIpInterfaces, nic.spec.getIp().ipAddress);
discoverIp6Interface(targetHost, ipInterface, nic);
}
if (isIp4Interface(nic)) {
IpInterface ipInterface = getOrCreateIpInterface(oldIpInterfaces, nic.spec.getIp().ipAddress);
discoverIp4Interface(targetHost, ipInterface, nic);
}
}
removeDiscoveredInterfaces(oldIpInterfaces);
info(String.format("Discovering initiators for %s", targetHost.forDisplay()));
Iterables.addAll(oldInitiators, getInitiators(targetHost));
for (HostHostBusAdapter hba : getHostBusAdapters(hostSystem)) {
if (hba instanceof HostFibreChannelHba) {
String port = SanUtils.normalizeWWN(((HostFibreChannelHba) hba).getPortWorldWideName());
Initiator initiator;
if (findInitiatorByPort(oldInitiators, port) == null) {
initiator = getOrCreateInitiator(targetHost.getId(), oldInitiators, port);
addedInitiators.add(initiator);
} else {
initiator = getOrCreateInitiator(targetHost.getId(), oldInitiators, port);
}
discoverInitiator(targetHost, initiator, (HostFibreChannelHba) hba);
} else if (hba instanceof HostInternetScsiHba) {
String iqn = ((HostInternetScsiHba) hba).getIScsiName();
Initiator initiator;
if (findInitiatorByPort(oldInitiators, iqn) == null) {
initiator = getOrCreateInitiator(targetHost.getId(), oldInitiators, iqn);
addedInitiators.add(initiator);
} else {
initiator = getOrCreateInitiator(targetHost.getId(), oldInitiators, iqn);
}
discoverInitiator(targetHost, initiator, (HostInternetScsiHba) hba);
}
}
if (!oldInitiators.isEmpty()) {
clearScaleIOInitiators(oldInitiators);
}
}
use of com.emc.storageos.db.client.model.IpInterface in project coprhd-controller by CoprHD.
the class HpuxHostDiscoveryAdapter method discoverIpInterfaces.
@Override
protected void discoverIpInterfaces(Host host, List<IpInterface> oldIpInterfaces) {
HpuxSystem hpux = getCli(host);
for (IPInterface nic : hpux.listIPInterfaces()) {
if (StringUtils.isNotBlank(nic.getIpAddress())) {
IpInterface ipInterface = getOrCreateIpInterface(oldIpInterfaces, nic.getIpAddress());
discoverIp4Interface(host, ipInterface, nic);
}
}
}
use of com.emc.storageos.db.client.model.IpInterface in project coprhd-controller by CoprHD.
the class LinuxHostDiscoveryAdapter method discoverIpInterfaces.
@Override
protected void discoverIpInterfaces(Host host, List<IpInterface> oldIpInterfaces) {
LinuxSystemCLI linux = createLinuxCLI(host);
for (IPInterface nic : linux.listIPInterfaces()) {
if (StringUtils.isNotBlank(nic.getIpAddress())) {
IpInterface ipInterface = getOrCreateIpInterface(oldIpInterfaces, nic.getIpAddress());
discoverIp4Interface(host, ipInterface, nic);
}
if (StringUtils.isNotBlank(nic.getIP6Address())) {
IpInterface ipInterface = getOrCreateIpInterface(oldIpInterfaces, StringUtils.substringBefore(nic.getIP6Address(), "/"));
discoverIp6Interface(host, ipInterface, nic);
}
}
}
Aggregations