Skip to content

ACM4CreateSnaps

Paul Armstrong edited this page Jan 26, 2022 · 7 revisions

ACM4CreateSnaps

This step is the fourth in the Automating Content Management workflow. It uses the underlying hypervisor to create snapshots of the hosts provisioned using the CreateTestEnv step. We are creating snapshots prior to application deployment to ensure that we have a before and eventually after image of the test hosts to compare. A future goal of the workflow is to reuse the snapshots in subsequent test runs to reduce the time to test.

The snapshots use the hypervisor platform to manage snapshots. It is not a goal of the project to provide snapshot code for a long list of platforms. In our case, the hypervisor is vmware and vmware code is called to create the snapshots. Using other hypervisor platform or host based snapshots is left as an exercise for the user. If you wish to extend this project by providing snapshot code for other platforms, pull requests are welcome.

The vmware folder contains all the code samples to manage guest snapshot manipulation and guest startup and shutdown tasks. For our example we call the vmw_create_snapshot.yml playbook. This play loops over the host list and calls the snapshot_action.yml task indicating that we want the snapshot to be present. snapshot_action.yml uses the community.vmware.vmware_guest_snapshot module to complete operations.

The snap description will be used to tag the snapshot with the content view version so that we can use it to determine the currency of the snapshot. This is a planned feature.

Secrets are stored in vault.yml Reference variables are stored in vmware.yml

As with other plays in this workflow, we are creating overrides in the variables attribute of the job template to control our particular deployment.

---
host_list:
# TODO: snap_description variable referencing content view version 
# for testing if deployment is current on multiple runs.
- name: testjboss.parmstrong.ca
  snap_name: testjboss.original
  snap_description: "test base jboss build - delete me"
  quiesce: true
- name: testlamp.parmstrong.ca
  snap_name: testlamp.original
  snap_description: "test base LAMP build - delete me"
  quiesce: true
- name: testwordpress.parmstrong.ca
  snap_name: testwordpress.original
  snap_description: "test base WordPress build - delete me"
  quiesce: true

Ansible Job Template Configuration Values

Name: ACM4CreateSnaps
Description: Step 4 - Create the test system snapshots using virtualization platform
Job Type: Run
Inventory: TheAutomationController
Project: AutomatingContentManagement
Execution Environment: default
Playbook: vmware/vmw_create_snapshot.yml
Enabled Options: Privilege Escalation
Credentials:
SSH:default
Vault:ACM_vault
Variables:

---
host_list:
- name: testjboss.parmstrong.ca
  snap_name: testjboss.original
  snap_description: "test base jboss build - delete me"
  quiesce: true
- name: testlamp.parmstrong.ca
  snap_name: testlamp.original
  snap_description: "test base LAMP build - delete me"
  quiesce: true
- name: testwordpress.parmstrong.ca
  snap_name: testwordpress.original
  snap_description: "test base WordPress build - delete me"
  quiesce: true

Workflow Branch

After this step the workflow separates into 3 branches. Each branch has multiple steps. Each branch will create and test a different environment that uses the underlying content views as a base for their code. The branches will converge again at step 6. If all branches complete successfully, the workflow will continue.