*** Settings ***
-Documentation Openstack library. This library is useful for tests to create network, subnet, router and vm instances
-Library Collections
-Library SSHLibrary
-Library OperatingSystem
-Resource SystemUtils.robot
-Resource ../variables/Variables.robot
-Resource ../variables/netvirt/Variables.robot
-Variables ../variables/netvirt/Modules.py
+Documentation Openstack library. This library is useful for tests to create network, subnet, router and vm instances
+
+Library Collections
+Library SSHLibrary
+Library OperatingSystem
+Resource SystemUtils.robot
+Resource ../variables/Variables.robot
+Resource ../variables/netvirt/Variables.robot
+Variables ../variables/netvirt/Modules.py
+
*** Keywords ***
Setup Basic Ssh
- [Arguments] ${node_ip} ${user_name} ${password} ${prompt}
[Documentation] Open SSh Connection and disable selinux
+ [Arguments] ${node_ip} ${user_name} ${password} ${prompt}
${connection}= Get Ssh Connection ${node_ip} ${user_name} ${password} ${prompt}
Disable SeLinux Tempororily ${connection}
- [Return] ${connection}
+ RETURN ${connection}
Get All Ssh Connections
[Documentation] Open All SSH Connections.
- Run Keyword If 0 < ${NUM_CONTROL_NODES} Setup Basic Ssh ${OS_CONTROL_1_IP} ${OS_USER} ${OS_USER_PASSWORD} ${OS_NODE_PROMPT}
- Run Keyword If 2 < ${NUM_CONTROL_NODES} Setup basic Ssh ${OS_CONTROL_2_IP} ${OS_USER} ${OS_USER_PASSWORD} ${OS_NODE_PROMPT}
- Run Keyword If 2 < ${NUM_CONTROL_NODES} Setup basic Ssh ${OS_CONTROL_3_IP} ${OS_USER} ${OS_USER_PASSWORD} ${OS_NODE_PROMPT}
- Run Keyword If 3 < ${NUM_CONTROL_NODES} Setup basic Ssh ${OS_CONTROL_4_IP} ${OS_USER} ${OS_USER_PASSWORD} ${OS_NODE_PROMPT}
- Run Keyword If 4 < ${NUM_CONTROL_NODES} Setup basic Ssh ${OS_CONTROL_5_IP} ${OS_USER} ${OS_USER_PASSWORD} ${OS_NODE_PROMPT}
- Run Keyword If 2 < ${NUM_CONTROL_NODES} Setup basic Ssh ${HAPROXY_IP} ${OS_USER} ${OS_USER_PASSWORD} ${OS_NODE_PROMPT}
- Run Keyword If 0 < ${NUM_COMPUTE_NODES} Setup basic Ssh ${OS_COMPUTE_1_IP} ${OS_USER} ${OS_USER_PASSWORD} ${OS_NODE_PROMPT}
- Run Keyword If 1 < ${NUM_COMPUTE_NODES} Setup basic Ssh ${OS_COMPUTE_2_IP} ${OS_USER} ${OS_USER_PASSWORD} ${OS_NODE_PROMPT}
+ IF 0 < ${NUM_CONTROL_NODES}
+ Setup Basic Ssh ${OS_CONTROL_1_IP} ${OS_USER} ${OS_USER_PASSWORD} ${OS_NODE_PROMPT}
+ END
+ IF 2 < ${NUM_CONTROL_NODES}
+ Setup basic Ssh ${OS_CONTROL_2_IP} ${OS_USER} ${OS_USER_PASSWORD} ${OS_NODE_PROMPT}
+ END
+ IF 2 < ${NUM_CONTROL_NODES}
+ Setup basic Ssh ${OS_CONTROL_3_IP} ${OS_USER} ${OS_USER_PASSWORD} ${OS_NODE_PROMPT}
+ END
+ IF 3 < ${NUM_CONTROL_NODES}
+ Setup basic Ssh ${OS_CONTROL_4_IP} ${OS_USER} ${OS_USER_PASSWORD} ${OS_NODE_PROMPT}
+ END
+ IF 4 < ${NUM_CONTROL_NODES}
+ Setup basic Ssh ${OS_CONTROL_5_IP} ${OS_USER} ${OS_USER_PASSWORD} ${OS_NODE_PROMPT}
+ END
+ IF 2 < ${NUM_CONTROL_NODES}
+ Setup basic Ssh ${HAPROXY_IP} ${OS_USER} ${OS_USER_PASSWORD} ${OS_NODE_PROMPT}
+ END
+ IF 0 < ${NUM_COMPUTE_NODES}
+ Setup basic Ssh ${OS_COMPUTE_1_IP} ${OS_USER} ${OS_USER_PASSWORD} ${OS_NODE_PROMPT}
+ END
+ IF 1 < ${NUM_COMPUTE_NODES}
+ Setup basic Ssh ${OS_COMPUTE_2_IP} ${OS_USER} ${OS_USER_PASSWORD} ${OS_NODE_PROMPT}
+ END
Enable Live Migration In A Node
[Arguments] ${compute_cxn}
Crudini Edit ${compute_cxn} /etc/libvirt/libvirtd.conf '' listen_tls 0
Crudini Edit ${compute_cxn} /etc/libvirt/libvirtd.conf '' listen_tcp 0
Crudini Edit ${compute_cxn} /etc/libvirt/libvirtd.conf '' auth_tcp '"none"'
- Crudini Edit ${compute_cxn} /etc/nova/nova.conf DEFAULT instances_path '/var/lib/nova/instances_live_migration'
+ Crudini Edit
+ ... ${compute_cxn}
+ ... /etc/nova/nova.conf
+ ... DEFAULT
+ ... instances_path
+ ... '/var/lib/nova/instances_live_migration'
Restart Service ${compute_cxn} openstack-nova-compute libvirtd
Enable Live Migration In All Compute Nodes
Enable Service ${control_node_cxn} httpd
Start Service ${control_node_cxn} httpd
Start Service ${control_node_cxn} openstack-glance-api openstack-glance-registry
- Start Service ${control_node_cxn} openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.servi ce openstack-nova-novncproxy.service
- Run Command ${os_node_cxn} sudo ovs-vsctl set-manager tcp:${OS_CONTROL_1_IP}:6640 tcp:${OS_CONTROL_2_IP}:6640 tcp:${OS_CONTROL_3_IP}:6640 tcp:${OS_CONTROL_4_IP}:6640 tcp:${OS_CONTROL_5_IP}:6640
- Start Service ${control_node_cxn} neutron-server.service neutron-dhcp-agent.service neutron-metadata-agent.service
+ Start Service
+ ... ${control_node_cxn}
+ ... openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.servi
+ ... ce openstack-nova-novncproxy.service
+ Run Command
+ ... ${os_node_cxn}
+ ... sudo ovs-vsctl set-manager tcp:${OS_CONTROL_1_IP}:6640 tcp:${OS_CONTROL_2_IP}:6640 tcp:${OS_CONTROL_3_IP}:6640 tcp:${OS_CONTROL_4_IP}:6640 tcp:${OS_CONTROL_5_IP}:6640
+ Start Service
+ ... ${control_node_cxn}
+ ... neutron-server.service neutron-dhcp-agent.service neutron-metadata-agent.service