# Adding a Post Script for a Failover Group

Add a post script to a machine in a failover group to execute an action on the destination VM after a failover operation.

## Before You Begin

Review the following information before configuring a pre or post script for the failover group.

### Required Components

To use pre or post scripts, you must have the following components configured:

- Amazon EC2: IAM role, SSM agent

  - Verify that the EC2 instance has an IAM role with the Amazon EC2SSMManagedInstanceCore policy attached.
  - Install and run the SSM agent on the EC2 instance.
  - Attach the IAM role to the destination instance.

- Azure: Azure VM agent

- VMware and VMware Cloud Director: VMware Tools/Open VM tools

### Supported Scripts

You can use the following scripts:

Amazon EC2

- Windows: Powershell

- Linux: Shell Scripts

Azure

- Windows: Powershell

- Linux: Shell Scripts

VMware

- Windows: Batch Scripts

- Linux: Shell Scripts

## Procedure

1. When you add a failover group, in the Add failover group - Replication dialog box, under Virtual machines, beside a VM, click the action button, and then select Add post script.

   The Configure post-failover script options dialog box appears.

2. Enter the following information:

   - Path type: For VMware only, select UNC or Local. For Amazon EC2 and Azure, configure a UNC path.

   - Path: Enter the full UNC network path for the post script, including the name of the script.

   - UNC Credentials: Enter credentials or use a set of saved credentials:

     - Enter credentials: Select this option to manually enter the user name and password for the UNC network.

       Username: Enter the user name for a user account that has permissions to access the network path for the script.

       Password: Enter the password for the user account.

     - Use saved credentials: Select this option to use a set of credentials that were previously saved for the UNC network.

       Credentials: Select a saved set of credentials.

       Add button : Click this button and then enter and save a set of credentials.

   - VM Guest Options: For VMware only, enter information for a VM Guest:

     - User name: Enter the user name for a user account that has permissions to access the network path for the script.

     - Password: Enter the password for the user account.

     - Confirm password: Enter the same password.

3. Click Save.

## Related Topics

To use sample scripts to validate VMs that run applications, see Application validation for VMware vSphere VMs.

×

Loading...