Minor updates to gate config

* Cleanup network in stop_gate.sh
* Use more reliable disk options
* Flush VM disk cache after join

Change-Id: Ia1f50842e6055aaf908f9932786dad691a2e9546
This commit is contained in:
Mark Burnett 2017-11-13 16:01:33 -06:00
parent d6a832e77f
commit 38ea3337e9
4 changed files with 15 additions and 5 deletions

View File

@ -75,8 +75,10 @@ iso_path() {
}
net_clean() {
log net_clean is not yet implemented.
exit 1
if virsh net-list --name | grep ^promenade$ > /dev/null; then
log Destroying promenade network
virsh net-destroy "${XML_DIR}/network.xml" &>> "${LOG_FILE}"
fi
}
net_declare() {
@ -120,6 +122,7 @@ vm_create() {
vol_create_root "${NAME}"
log Creating VM "${NAME}"
DISK_OPTS="bus=virtio,cache=directsync,discard=unmap,format=qcow2"
virt-install \
--name "${NAME}" \
--virt-type kvm \
@ -130,9 +133,9 @@ vm_create() {
--vcpus "$(config_vm_vcpus)" \
--memory "$(config_vm_memory)" \
--import \
--disk "vol=${VIRSH_POOL}/promenade-${NAME}.img,format=qcow2,bus=virtio" \
--disk "pool=${VIRSH_POOL},size=20,format=qcow2,bus=virtio" \
--disk "pool=${VIRSH_POOL},size=20,format=qcow2,bus=virtio" \
--disk "vol=${VIRSH_POOL}/promenade-${NAME}.img,${DISK_OPTS}" \
--disk "pool=${VIRSH_POOL},size=20,${DISK_OPTS}" \
--disk "pool=${VIRSH_POOL},size=20,${DISK_OPTS}" \
--disk "vol=${VIRSH_POOL}/cloud-init-${NAME}.iso,device=cdrom" &>> "${LOG_FILE}"
ssh_wait "${NAME}"

View File

@ -16,6 +16,9 @@ for NAME in ${JOIN_TARGETS}; do
ssh_cmd "${NAME}" "/root/promenade/join-${NAME}.sh"
ssh_cmd "${NAME}" "/root/promenade/validate-${NAME}.sh"
# NOTE(mark-burnett): Ensure disk cache is flushed after join.
ssh_cmd "${NAME}" sync
done
validate_cluster n0

View File

@ -20,3 +20,6 @@ validate_cluster n1
validate_etcd_membership kubernetes n1 "${EXPECTED_MEMBERS}"
validate_etcd_membership calico n1 "${EXPECTED_MEMBERS}"
# NOTE(mark-burnett): Ensure disk cache is flushed after join.
ssh_cmd "${GENESIS_NAME}" sync

View File

@ -12,4 +12,5 @@ export WORKSPACE
source "${GATE_UTILS}"
vm_clean_all
net_clean
registry_down