MCPcopy Create free account
hub / github.com/apache/cloudstack / get_ssh_client

Method get_ssh_client

tools/marvin/marvin/lib/base.py:827–859  ·  view source on GitHub ↗

Get SSH object of VM

(
            self, ipaddress=None, reconnect=False, port=None,
            keyPairFileLocation=None, retries=20)

Source from the content-addressed store, hash-verified

825 return apiclient.restoreVirtualMachine(cmd)
826
827 def get_ssh_client(
828 self, ipaddress=None, reconnect=False, port=None,
829 keyPairFileLocation=None, retries=20):
830 """Get SSH object of VM"""
831
832 # If NAT Rules are not created while VM deployment in Advanced mode
833 # then, IP address must be passed
834 if ipaddress is not None:
835 self.ssh_ip = ipaddress
836 if port:
837 self.ssh_port = port
838
839 if keyPairFileLocation is not None:
840 self.password = None
841
842 if reconnect:
843 self.ssh_client = is_server_ssh_ready(
844 self.ssh_ip,
845 self.ssh_port,
846 self.username,
847 self.password,
848 retries=retries,
849 keyPairFileLocation=keyPairFileLocation
850 )
851 self.ssh_client = self.ssh_client or is_server_ssh_ready(
852 self.ssh_ip,
853 self.ssh_port,
854 self.username,
855 self.password,
856 retries=retries,
857 keyPairFileLocation=keyPairFileLocation
858 )
859 return self.ssh_client
860
861 def getState(self, apiclient, state, timeout=600):
862 """List VM and check if its state is as expected

Callers 2

setup_webserverMethod · 0.45
check_ssh_into_vmMethod · 0.45

Implementers 2

VMEntityVOengine/schema/src/main/java/org/apache
VMInstanceVOengine/schema/src/main/java/com/cloud/

Calls 1

is_server_ssh_readyFunction · 0.90

Tested by 2

setup_webserverMethod · 0.36
check_ssh_into_vmMethod · 0.36