/** * Returns the number of dead paths to the storage of a host */ private void getHostDeadPaths(String hostName, PrintWriter out) throws IOException { try { HostSystem host = (HostSystem) getManagedEntity(hostName, "HostSystem"); Integer nb = 0; if (host == null) { LOG.warn("No host named '" + hostName + "' found"); } else { HostConfigInfo hc = host.getConfig(); HostMultipathStateInfoPath[] mp = hc.getMultipathState().getPath(); for (int m = 0; m < mp.length; m++) { if ("dead".equals(mp[m].getPathState())) { nb++; } } } out.print(nb); out.flush(); } catch (Exception ex) { LOG.error("An error occurred : " + ex.toString()); } }
/** * Returns the number of standby paths to the storage of a host */ private void getHostStandbyPaths(String hostName, PrintWriter out) throws IOException { try { HostSystem host = (HostSystem) getManagedEntity(hostName, "HostSystem"); Integer nb = 0; if (host == null) { LOG.warn("No host named '" + hostName + "' found"); } else { HostConfigInfo hc = host.getConfig(); HostMultipathStateInfoPath[] mp = hc.getMultipathState().getPath(); for (int m = 0; m < mp.length; m++) { if ("standby".equals(mp[m].getPathState())) { nb++; } } } out.print(nb); out.flush(); } catch (Exception ex) { LOG.error("An error occurred : " + ex.toString()); } }
/** * Returns the number of disabled paths to the storage of a host */ private void getHostDisabledPaths(String hostName, PrintWriter out) throws IOException { try { HostSystem host = (HostSystem) getManagedEntity(hostName, "HostSystem"); Integer nb = 0; if (host == null) { LOG.warn("No host named '" + hostName + "' found"); } else { HostConfigInfo hc = host.getConfig(); HostMultipathStateInfoPath[] mp = hc.getMultipathState().getPath(); for (int m = 0; m < mp.length; m++) { if ("disabled".equals(mp[m].getPathState())) { nb++; } } } out.print(nb); out.flush(); } catch (Exception ex) { LOG.error("An error occurred : " + ex.toString()); } }
/** * Returns the number of active paths to the storage of a host */ private void getHostActivePaths(String hostName, PrintWriter out) throws IOException { try { HostSystem host = (HostSystem) getManagedEntity(hostName, "HostSystem"); Integer nb = 0; if (host == null) { LOG.warn("No host named '" + hostName + "' found"); } else { //TODO: cache for all HostConfigInfo HostConfigInfo hc = host.getConfig(); HostMultipathStateInfoPath[] mp = hc.getMultipathState().getPath(); for (int m = 0; m < mp.length; m++) { if ("active".equals(mp[m].getPathState())) { nb++; } } } out.print(nb); out.flush(); } catch (Exception ex) { LOG.error("An error occurred : " + ex.toString()); } }
ScsiLun[] scsiLuns = (ScsiLun[])host.getConfig().getStorageDevice().getScsiLun();
ScsiLun[] scsiLuns = (ScsiLun[])host.getConfig().getStorageDevice().getScsiLun();
new DistributedVirtualSwitchHostMemberPnicBacking(); PhysicalNic[] pnics = ((HostSystem)hosts[i]).getConfig().getNetwork().getPnic();
new DistributedVirtualSwitchHostMemberPnicBacking(); PhysicalNic[] pnics = ((HostSystem)hosts[i]).getConfig().getNetwork().getPnic();