22.0 Workload-Driven Cloud Services > How-to's > Canceling a service

Conventions

22.5 Canceling a service

To cancel a service

  1. When creating the service workflow, include a destroy job that will delete the service (all VMs, storage, etc.) when the main job is canceled.
  2. Set the DestroyObjects flag on the service's main VC.
  3. > mvcctl -m flags+=DestroyObjects vc1

  4. Run mvcctl -d on the VC. The DestroyObjects flag causes Moab to tear down the entire service, using destroy template jobs where they exist.
  5. > mvcctl -d vc1

    vc1 and all of its objects are destroyed.

  6. Alternately, rather than doing steps 2-3, you can run canceljob on the select job of each workflow to delete the service. This will retain the main job while the destroy job runs. Once the destroy job completes successfully, the main job or VM-tracking job will cancel.
  7. mvmctl -d will also destroy the VM; however, Moab does not automatically delete attached resource workflows, like storage mounts. You must use canceljob on the select (tracking) job of each attached workflow to destroy the whole service.