How to run errands without "Apply Change" on the Ops Manager
search cancel

How to run errands without "Apply Change" on the Ops Manager

book

Article ID: 293581

calendar_today

Updated On:

Products

Operations Manager

Issue/Introduction

After successfully deploying Pivotal Cloud Foundry (PCF) Elastic Runtime and Service Tiles through Operations (Ops) Manager, you might need to run errands due to situations such as:

  • Redeploy Notification Service, Autoscaling Service, etc. after the first install.
  • Run smoke-test upon Elastic Runtime or Service Tiles after install.

It is usually easier to debug problems when you run errands manually. By setting the "--keep-alive" flag, the errand VM will be kept alive for debugging purposes. Please refer the Pivotal Knowledge Base article How to run errands step-by-step for details.

Most of the above tasks can be done through Ops Manager by selecting/or deselecting errands, and then clicking "Apply Change". However, it may take more time compared to running errands through BOSH commands. This article discusses how to run BOSH errands directly.


Environment


Resolution

To run BOSH errands directly, follow the instructions below: 

1. Log on to Ops Manager VM via Single SHell (SSH); there are other options like a jump box. The advantage of using Ops Manager VM is BOSH CLI and deployment manifest files are already available on the VM.

2. List up all deployments with the "bosh deployments" command.  

3. Set current deployment to the tile which you want to execute errands:
bosh deployment /var/tempest/workspaces/default/deployments/<deployment name>.yml
4. Execute the "bosh run errand' command", it will list up all available errands within the deployment:

Here is an example of running an errand of Elastic Runtime:

$ bosh run errand
RSA 1024 bit CA certificates are loaded due to old openssl compatibility
1. push-apps-manager
2. smoke-tests
3. notifications
4. notifications-tests
5. notifications-ui
6. notifications-ui-tests
7. autoscaling
8. autoscaling-register-broker
9. autoscaling-destroy-broker
10. autoscaling-tests
11. acceptance-tests
Choose an errand: 
5. Input the errand index you want to run and press "Enter".

For bosh v2 CLI, you will need to use the following syntax:

To list errands:

bosh -e <environment name> -d <deployment name> errands

To run an errand:

bosh -e <environment name> -d <deployment name> run-errand <errand-name>

For example:

bosh -e MY-ENV -d cf-122f0c8a3469b9481b25 run-errand smoke-test

For PAS deployments with more than one clock_global VM (two VMs is the default from PAS 2.3), you should specify which instance to run the errand on. The 'first' keyword will choose the first available instance:

bosh -e MY-ENV -d cf-122f0c8a3469b9481b25 run-errand smoke-test     
--instance=clock_global/first

Reference: https://bosh.io/docs/errands/


Additional Information

IMPORTANT NOTE: Do not run errands such as "Unregister Broker" or "Destroy Broker". These are meant to be run when uninstalling tiles and running them will usually result in data loss.  As a result, Pivotal Support does not recommend that you run errands manually in production environments. If you have any questions or reservations about running a specific errand, please contact Pivotal Support before running the errand.