use of com.cloud.legacymodel.communication.command.CheckSshCommand in project cosmic by MissionCriticalCloud.
the class ConsoleProxyManagerImpl method finalizeCommandsOnStart.
@Override
public boolean finalizeCommandsOnStart(final Commands cmds, final VirtualMachineProfile profile) {
NicProfile managementNic = null;
NicProfile controlNic = null;
for (final NicProfile nic : profile.getNics()) {
if (nic.getTrafficType() == TrafficType.Management) {
managementNic = nic;
} else if (nic.getTrafficType() == TrafficType.Control && nic.getIPv4Address() != null) {
controlNic = nic;
}
}
if (controlNic == null) {
if (managementNic == null) {
logger.error("Management network doesn't exist for the console proxy vm " + profile.getVirtualMachine());
return false;
}
controlNic = managementNic;
}
final CheckSshCommand check = new CheckSshCommand(profile.getInstanceName(), controlNic.getIPv4Address(), 3922);
cmds.addCommand("checkSsh", check);
return true;
}
Aggregations