Methods¶
Make SSH connection¶
This module is to make connection with newly added compute resources
-
satellite.modules.ssh_connect.
copy_ssh_id
(ip_address, password)[source]¶ Copy SSH key with remote system
Parameters: - ip_address – IP address of remote system (Compute resource)
- password – Root password of remote system
Returns: True
-
satellite.modules.ssh_connect.
make_connection
(ip_address, password)[source]¶ Check the compute is reachable and password is correct or not
Parameters: - ip_address – IP address of remote system (Compute resource)
- password – Root password of remote system
Returns: Calls the copy_ssh_id(ip_address, password) to copy SSH key else error
Manage virtual machine¶
This module is to manage virtual machines in Minisat
-
satellite.modules.vm_manage.
change_repo
(compute_ip, vm_ip, repo_id, repo_flag, vm_name)[source]¶ Change the repo status
Parameters: - compute_ip – IP address of compute on which virtual machine is running
- vm_ip – IP address of virtual machine
- repo_id – repo ID
- repo_flag – flag of repo (enable or disable)
- vm_name – Name of virtual machine
Returns: success or failed
-
satellite.modules.vm_manage.
filter_repo
(repo_info)[source]¶ Filter the repos
Remove all unnecessary data from repos
Parameters: repo_info – Raw repo data Returns repo_info: Cleaned repo data
-
satellite.modules.vm_manage.
get_memory
(compute_ip, vm_name, vm_ip)[source]¶ Find memory consumption of virtual machine
Parameters: - compute_ip – Compute IP on which virtual machine is running
- vm_name – Name of virtual machine
- vm_ip – IP address of virtual machine
Returns total_mem: Total memory of virtual machine
Returns free_mem: Free memory of virtual machine
-
satellite.modules.vm_manage.
get_packages
(compute_ip, vm_ip, root_passwd)[source]¶ Get packages installed in virtual machine
Parameters: - compute_ip – IP address of compute on which virtual machine is running
- vm_ip – IP address of virtual machine
- root_passwd – Root password of virtual machine
Returns package_info: List of all packages in virtual machine
-
satellite.modules.vm_manage.
get_repo
(activation_name)[source]¶ Get repo list included in Activation name
Parameters: activation_name – Name of activation Returns repo: Dictionary of repo name and repo URL included in that activation
-
satellite.modules.vm_manage.
get_status
(compute_name, compute_ip, vm_name)[source]¶ Get status of virtual machine
Parameters: - compute_name – Name of compute on which virtual machine is running
- compute_ip – Compute IP on which virtual machine is running
- vm_name – Name of virtual machine
Returns: Running or Initializing
-
satellite.modules.vm_manage.
get_vm_repo
(compute_ip, vm_ip, vm_name)[source]¶ Get virtual machine repo
Find repo added in virtual machine and its status whether its enable or disable
Parameters: - compute_ip – IP address of compute on which virual machine is running
- vm_ip – IP address of virtual machine
- vm_name – Name of virtual machine
Returns repo_info: Contain of list of enabled and disabled repo
-
satellite.modules.vm_manage.
isOnline
(host)[source]¶ Check whether host is online or offline
Parameters: host – IP of remote system Returns: True if online else False
-
satellite.modules.vm_manage.
virsh_delete_vm
(vm_name, com_ip)[source]¶ Delete the virtual machine on remote system
Parameters: - vm_name – Name of virtual machine
- com_ip – Compute IP on which virtual machine is running
Returns: delete_vm_flag
-
satellite.modules.vm_manage.
virsh_pause_vm
(vm_name, com_ip)[source]¶ Shutdown the virtual machine on remote system :param vm_name: Name of virtual machine :param com_ip: Compute IP on which virtual machine is running
Returns: shut_vm_flag
-
satellite.modules.vm_manage.
virsh_start_vm
(vm_name, com_ip)[source]¶ Starts the virtual machine on remote system :param vm_name: Name of virtual machine :param com_ip: Compute IP on which virtual machine is running
Returns: start_vm_flag
-
satellite.modules.vm_manage.
vm_create
(compute_ip, name, ram, cpus, disk_size, location_url, kickstart_loc)[source]¶ Create virtual machine on remote system
Parameters: - compute_ip – Remote system IP address
- name – Name of virtual machine
- ram – RAM size for virtual machine
- cpus – Number of virtual CPUS for virtual machine
- disk_size – Disk size for virtual machine
- location_url – URL location of OS
- kickstart_loc – location of kickstart
Returns: Boolean, True if success or False
-
satellite.modules.vm_manage.
vm_details
(compute_name, compute_ip, vm_id)[source]¶ Find details of virtual machine
In this function virtual machine details like ID, name, state(Running or shut), virtual CPUs, Total memory allocated, Free memory, virtual machine IP address, virtual machine MAC address, Compute name (on which it is provisioned).
Parameters: - compute_name – Name of compute on which virtual machine is running
- compute_ip – IP address of compute on which virtual machine is running
- vm_id – UUID of virtual machine
Returns details: Dictionary of ID, name, state(Running or shut), virtual CPUS, Total memory allocated, Free memory, virtual machine IP address, virtual machine MAC address, Compute name
Create kickstart file¶
This module generate the kickstart file for virtual machine
-
satellite.modules.kickstart.
kick_gen
(vm_name, passwd, location, repo)[source]¶ Generate kickstart file
Parameters: - vm_name – Name of virtual machine
- passwd – Password of virtual machine
- location – Location of operating system
- repo – List of repo needed to add in virtual machine
Returns: location of kickstart file
Manage Docker container¶
This module is to manage Docker container in Minisat
-
satellite.modules.docker_manage.
destroy_cont
(cont_name, compute_name)[source]¶ Destroy a container
Parameters: - cont_name – Name of container
- compute_name – Name of compute
Returns: Destroyed if success else 0
-
satellite.modules.docker_manage.
get_docker_images
(compute=[])[source]¶ Get Docker images available in all the compute resources
Parameters: compute – Name of compute resources Returns docker_dict: Dictionary of docker images available
-
satellite.modules.docker_manage.
make_connection
(ip_address, name)[source]¶ Make Docker connection using docker-machine
Parameters: - ip_address – IP address of remote machine
- name – Name of docker-machine connection
Returns: True if success or False
-
satellite.modules.docker_manage.
run_cont
(new_cont, stat)[source]¶ Run the container
Parameters: - new_cont – Class of container details
- stat – Running status
Fetch data for dashboard¶
dashboard_details fetch data from remote compute system and virtual machine to display on dashboard
Testcase of Minisat¶
This Module is for testing Minisat. All testcase are tested on Travis-CI and triggered when new pull request is opened. Most of the tesing is done by Selenium and in headless mode.
-
satellite.test_minisat.
test_operating_system
()[source]¶ Test Operating System page Some testcase are already designed with their expected output. If testcase fails it will split error.
-
satellite.test_minisat.
test_pep8
()[source]¶ Testing PEP 8 standards. Flake8 is use to check PEP 8.
Error E501 (line too long error), E122 (Continuation line missing indentation or outdented), E722 (do not use bare except) are ignored.
-
satellite.test_minisat.
test_product
()[source]¶ Test product page Some testcase are already designed with their expected output. If testcase fails it will split error.