Inventory dependencies first, rehearse the change and its recovery, then automate only the steps that have passed the checks.

A VM can exist in vCenter while its DNS record, network access and monitoring are still missing. If your workflow reports “delivered” at VM creation, the ticket closes before the service is usable. Build around the handover criteria first, then decide which tool owns each step.

1. Define what “delivered” means

For one VM request, agree the FQDN, network, storage policy and owner before touching the platform. Define the checks that close the request: the guest resolves from the intended client network, the application port responds from an allowed source, and the monitoring platform receives its first signal. Save the VM ID and check results against the request ID.

2. Map each dependency to its owner

  • IPAM and DNS: reserve the address in the authoritative IPAM and record its reservation ID. Check the requested name against DNS. If the name belongs to another request, stop rather than overwrite it.
  • Compute and storage: resolve the network and storage policy to their platform IDs. Create the VM only after these match the approved inputs. Record its platform ID before handing off to guest configuration.
  • Network policy and monitoring: identify the teams or services that own these changes. Wait for observable evidence that the policy is active and monitoring has seen the guest.

Put the dependency order, owner, timeout and stop condition in the workflow definition. Give each resource one writer. If Terraform owns the VM, use a backend that supports state locking to guard against concurrent Terraform state writes. That lock does not cover IPAM, DNS or a separate automation tool.

3. Decide what a rerun does

Suppose VM creation succeeds but the DNS call times out. Read back the VM and the DNS record before retrying: the DNS write may already have succeeded. If the VM and IP reservation both belong to the request and the expected DNS record is absent, resume at DNS. If the record conflicts or ownership is unclear, stop and hand the request IDs to the operator. Never delete a VM solely because a later step failed.

If you use Ansible, define the recovery tasks explicitly. A block's rescue section runs on a failed task; unreachable hosts and invalid task definitions do not trigger it. Test those paths separately. Ansible check mode is not a rollback plan.

4. Prove it with one pilot

Run a successful request, rerun it unchanged and confirm that there is still only one VM, one reservation and one DNS record. Then interrupt execution after VM creation and exercise both a safe resume and a naming conflict. Hand the evidence to an operator who did not write the workflow. Expand to another use case only when that operator can tell what exists, what failed and what to do next.