summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2019-02-21 16:42:56 +0000
committerGerrit Code Review <review@openstack.org>2019-02-21 16:42:56 +0000
commit564c262065fb28c7f475c5f8ac18582202c9ce4c (patch)
treefc043f1eabc234f443696aa37d22747bbb9c5b34
parent3c92934ecef245a5b59d80a1824ccd5d3684f1b0 (diff)
parent83fe3e1682c3fe0920895e9c8ef950ca2994d2e1 (diff)
Merge "The virsh network and volume pool made persistent"
-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() {