summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArijit Bose <imarijitbose@gmail.com>2019-02-19 14:29:13 -0600
committerArijit Bose <imarijitbose@gmail.com>2019-02-21 09:54:02 -0600
commit83fe3e1682c3fe0920895e9c8ef950ca2994d2e1 (patch)
tree29341486575c2a2a5d1ccbf87476fd90fe7893aa
parent683dfc8190ff943b1fe1d7a9afa38fed7ca9adb5 (diff)
The virsh network and volume pool made persistent
1. The network pool persistent and autostarted 2. The volume pool made persistent and autostarted 3. The vms are made autostarted Change-Id: Ie6c66a1862e002c5cf7e2911a39dc051b50faab3
Notes
Notes (review): Code-Review+2: Scott Hussey <sthussey@att.com> Code-Review+2: Kaspars Skels <kaspars.skels@gmail.com> Workflow+1: Kaspars Skels <kaspars.skels@gmail.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Thu, 21 Feb 2019 16:42:56 +0000 Reviewed-on: https://review.openstack.org/637991 Project: openstack/airship-in-a-bottle Branch: refs/heads/master
-rw-r--r--tools/multi_nodes_gate/airship_gate/lib/virsh.sh13
1 files changed, 9 insertions, 4 deletions
diff --git a/tools/multi_nodes_gate/airship_gate/lib/virsh.sh b/tools/multi_nodes_gate/airship_gate/lib/virsh.sh
index 8a8d767..6d288b5 100644
--- a/tools/multi_nodes_gate/airship_gate/lib/virsh.sh
+++ b/tools/multi_nodes_gate/airship_gate/lib/virsh.sh
@@ -96,7 +96,9 @@ net_clean() {
96net_declare() { 96net_declare() {
97 if ! virsh net-list --name | grep ^airship_gate$ > /dev/null; then 97 if ! virsh net-list --name | grep ^airship_gate$ > /dev/null; then
98 log Creating Airship gate network 98 log Creating Airship gate network
99 virsh net-create "${XML_DIR}/network.xml" &>> "${LOG_FILE}" 99 virsh net-define "${XML_DIR}/network.xml" &>> "${LOG_FILE}"
100 virsh net-start airship_gate
101 virsh net-autostart airship_gate
100 fi 102 fi
101} 103}
102 104
@@ -104,7 +106,9 @@ pool_declare() {
104 log Validating virsh pool setup 106 log Validating virsh pool setup
105 if ! virsh pool-uuid "${VIRSH_POOL}" &> /dev/null; then 107 if ! virsh pool-uuid "${VIRSH_POOL}" &> /dev/null; then
106 log Creating pool "${VIRSH_POOL}" 108 log Creating pool "${VIRSH_POOL}"
107 virsh pool-create-as --name "${VIRSH_POOL}" --type dir --target "${VIRSH_POOL_PATH}" &>> "${LOG_FILE}" 109 virsh pool-define-as --name "${VIRSH_POOL}" --type dir --target "${VIRSH_POOL_PATH}" &>> "${LOG_FILE}"
110 virsh pool-start "${VIRSH_POOL}"
111 virsh pool-autostart "${VIRSH_POOL}"
108 fi 112 fi
109} 113}
110 114
@@ -166,8 +170,8 @@ vm_create() {
166 --disk "vol=${VIRSH_POOL}/cloud-init-${NAME}.iso,device=cdrom" &>> "${LOG_FILE}" 170 --disk "vol=${VIRSH_POOL}/cloud-init-${NAME}.iso,device=cdrom" &>> "${LOG_FILE}"
167 171
168 ssh_wait "${NAME}" 172 ssh_wait "${NAME}"
169 ssh_cmd "${NAME}" cloud-init status --wait 173 ssh_cmd "${NAME}" cloud-init status --wait
170 ssh_cmd "${NAME}" sync 174 ssh_cmd "${NAME}" sync
171 175
172 else 176 else
173 log Creating VM "${NAME}" 177 log Creating VM "${NAME}"
@@ -184,6 +188,7 @@ vm_create() {
184 --import \ 188 --import \
185 --disk "vol=${VIRSH_POOL}/airship-gate-${NAME}.img,${DISK_OPTS}" &>> "${LOG_FILE}" 189 --disk "vol=${VIRSH_POOL}/airship-gate-${NAME}.img,${DISK_OPTS}" &>> "${LOG_FILE}"
186 fi 190 fi
191 virsh autostart "${NAME}"
187} 192}
188 193
189vm_create_validate() { 194vm_create_validate() {