xenapi: Use a jeos vm as a template
DevStack was using templating to speed up the setup process with XenServer. The template already included some devstack customisations, not just a clean OS. This change modifies devstack behaviour, so that the template is a simple clean operating system. This makes it easier to use custom OS as a template, potentially speeding up the tests. related to blueprint xenapi-devstack-cleanup Change-Id: I6cb0a7ed7a90e749b78329a8e2b65fb8b7fcfa5f
This commit is contained in:
@@ -167,8 +167,8 @@ fi
|
|||||||
#
|
#
|
||||||
|
|
||||||
GUEST_NAME=${GUEST_NAME:-"DevStackOSDomU"}
|
GUEST_NAME=${GUEST_NAME:-"DevStackOSDomU"}
|
||||||
TNAME="devstack_template"
|
TNAME="jeos_template_for_devstack"
|
||||||
SNAME_PREPARED="template_prepared"
|
SNAME_TEMPLATE="jeos_snapshot_for_devstack"
|
||||||
SNAME_FIRST_BOOT="before_first_boot"
|
SNAME_FIRST_BOOT="before_first_boot"
|
||||||
|
|
||||||
function wait_for_VM_to_halt() {
|
function wait_for_VM_to_halt() {
|
||||||
@@ -234,21 +234,8 @@ if [ -z "$templateuuid" ]; then
|
|||||||
vm_uuid=$(xe_min vm-list name-label="$GUEST_NAME")
|
vm_uuid=$(xe_min vm-list name-label="$GUEST_NAME")
|
||||||
xe vm-param-set actions-after-reboot=Restart uuid="$vm_uuid"
|
xe vm-param-set actions-after-reboot=Restart uuid="$vm_uuid"
|
||||||
|
|
||||||
#
|
|
||||||
# Prepare VM for DevStack
|
|
||||||
#
|
|
||||||
|
|
||||||
# Install XenServer tools, and other such things
|
|
||||||
$THIS_DIR/prepare_guest_template.sh "$GUEST_NAME"
|
|
||||||
|
|
||||||
# start the VM to run the prepare steps
|
|
||||||
xe vm-start vm="$GUEST_NAME"
|
|
||||||
|
|
||||||
# Wait for prep script to finish and shutdown system
|
|
||||||
wait_for_VM_to_halt
|
|
||||||
|
|
||||||
# Make template from VM
|
# Make template from VM
|
||||||
snuuid=$(xe vm-snapshot vm="$GUEST_NAME" new-name-label="$SNAME_PREPARED")
|
snuuid=$(xe vm-snapshot vm="$GUEST_NAME" new-name-label="$SNAME_TEMPLATE")
|
||||||
xe snapshot-clone uuid=$snuuid new-name-label="$TNAME"
|
xe snapshot-clone uuid=$snuuid new-name-label="$TNAME"
|
||||||
else
|
else
|
||||||
#
|
#
|
||||||
@@ -257,6 +244,19 @@ else
|
|||||||
vm_uuid=$(xe vm-install template="$TNAME" new-name-label="$GUEST_NAME")
|
vm_uuid=$(xe vm-install template="$TNAME" new-name-label="$GUEST_NAME")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#
|
||||||
|
# Prepare VM for DevStack
|
||||||
|
#
|
||||||
|
|
||||||
|
# Install XenServer tools, and other such things
|
||||||
|
$THIS_DIR/prepare_guest_template.sh "$GUEST_NAME"
|
||||||
|
|
||||||
|
# start the VM to run the prepare steps
|
||||||
|
xe vm-start vm="$GUEST_NAME"
|
||||||
|
|
||||||
|
# Wait for prep script to finish and shutdown system
|
||||||
|
wait_for_VM_to_halt
|
||||||
|
|
||||||
## Setup network cards
|
## Setup network cards
|
||||||
# Wipe out all
|
# Wipe out all
|
||||||
destroy_all_vifs_of "$GUEST_NAME"
|
destroy_all_vifs_of "$GUEST_NAME"
|
||||||
|
Reference in New Issue
Block a user