VMworld 2013: Three Quirky Ways to Simplify DR with VMware Site Recovery Manager

Post on 05-Dec-2014

89 views 1 download

description

VMworld 2013 Ben Meadowcroft, VMware Learn more about VMworld and register at http://www.vmworld.com/index.jspa?src=socmed-vmworld-slideshare

Transcript of VMworld 2013: Three Quirky Ways to Simplify DR with VMware Site Recovery Manager

Three Quirky Ways to Simplify DR with

Site Recovery Manager

Ben Meadowcroft, VMware

BCO5652

#BCO5652

3

Agenda

Introduction

SRM Command Steps

SRM Alarms

SRM API

Summary

Questions

4

“Three Quirky Ways” – What This Talk is Not

5

“Three Quirky Ways” – What This Talk is

How to use some of the

“under-appreciated” SRM

features to help your Disaster

Recovery processes

6

7

8

10

Which “under-appreciated” features do you mean?

Command Steps

Events & Alarms

API

1

2

3

11

Command Steps

API

1

2

3

Events & Alarms

12

Extend Your Recovery Plans

Recover Physical

Workloads

Update DNS

Send Recovery

Notifications

Integrate With

Other Systems

13

SRM Command Steps

Top-Level Commands Per-VM Commands

Where can

they

execute?

On the SRM server On the SRM server

On the Recovered VM

(requires VM tools)

When can

they

execute?

Any top level step during:

Failover, Migration, or Testing

Pre or Post Power-on

When executed on the VM

only post power-on steps!

Environment

Variables?

VMware_RecoveryName

VMware_RecoveryMode

VMware_VC_Host

VMware_VC_Port

VMware_VM_Uuid

VMware_VM_Name

VMware_VM_Ref

VMware_VM_Path

Post Power-On:

VMware_VM_GuestName

VMware_VM_GuestIP

14

Demo Time: What Am I Going To Show?

1. Call PowerShell script on SRM server

2. Call /bin/sh on recovered VM

3. How do I write scripts that work for both failover and failback?

4. Can I execute different behavior between test and failover?

5. How do I securely store credentials in my scripts?

15

16

1. Call PowerShell Script On SRM Server

17

2. Call /bin/sh On Recovered VM

18

3. How do I Write Scripts that Work for Both Failover and Failback?

# PowerShell

if ($env:VMware_VC_Host -eq ‘vc-w8-01a.corp.local‘) {

# action when target is site A

} else {

# action when target is site B

}

19

4. Can I Execute Different Behavior Between Test and Failover?

# PowerShell

if ($env:VMware_VC_RecoveryMode -eq ‘test‘) { # action during test

} else {

# other action

}

20

5. How Do I Securely Store Credentials in My Scripts?

# PowerCLI to store

New-VICredentialStoreItem ` –Host $env:VMware_VC_Host `

–User ‘Administrator’ `

–Password ‘VMware1!’ `

–File ‘c:\scripts\vicredentials.txt’

21

SRM Command Steps – Key Takeaways

Useful tool but not a “hammer” for everything

Don’t do too much in custom scripts

• Look at RTO impact running a script

Avoid changing scripts for failback

• Use Environment Variables for conditional logic

22

Command Steps

API

1

2

3

Events & Alarms

23

“There are known knowns. These are things we know that we know.

“There are known unknowns. That is to say, there are things that we know we don't know.

“But there are also unknown unknowns. There are things we don't know we don't know.”

- Donald Rumsfeld

24

6 Types of SRM Events

Site Status

vSphere

Replication

Protection Group Storage and

Storage Provider

Permissions &

Licensing

Recovery

25

Some Interesting Alarms To Monitor

Remote Site Down VM Not Protected

VM Datastore

Replication Lost

Placeholder VM

Deleted

Array Pair Ping

Failed

VM Lost

License Expiring

License Expired

Recovery Plan

Destroyed

Recovery Plan

Started

vSphere Replication

Paused

RPO Violated

Remote VRM Site

Disconnected

26

Email

Scripts

SNMP

What can

I do with

SRM alarms?

28

“Known Unknowns”

“Known Knowns”

29

Command Steps

API

1

2

3

Events & Alarms

30

SRM API Basics

https://www.vmware.com/support/developer/srm-api/

Web Service .Net SDK Java SDK

Protection

Groups and

Replication

Recovery Plans

and Reprotection

31

32

“Gotchas” When Calling SRM API From PowerShell

PowerShell v3 or later

• (v2 can’t handle the WSDL)

New-WebServiceProxy

•Not a lightweight call!

•Useful for POC, exploration etc.

33

SRM API – Key Takeaways

Introspect & Protect:

•Protection Group Information

•Recovery History

•Configure VMs for protection

Initiate:

•Failover

•Test

•Cancel

•Revert

•Reprotect

34

Command Steps

Events & Alarms

API

1

2

3

37

Questions

github.com/benmeadowcroft/BCO5652

@BenMeadowcroft benmeadowcroft.com

38

Backup: Resources

Related Sessions at VMworld

• BCO4905 - Disaster Recovery Solution with Oracle Data Guard and Site

Recovery Manager

• OPT5474 - The Transformative Power and Business Case

for Cloud Automation

SRM Documentation

• http://www.vmware.com/support/pubs/srm_pubs.html

SRM Book

• Administering VMware Site Recovery Manager 5 – by Mike Laverick

Scripts From Presentation

• https://github.com/benmeadowcroft/BCO5652

[provided for illustrative purposes only]

39

Backup: Managing Scripts

Source Control

• Use it (I like DVCS like mercurial and git)

Script Location

• Local Disk

• Network Share (personally not a huge fan of this, potential POF during DR)

Keeping Scripts in Sync (if stored on SRM server or VM)

• Various Options:

• Config. management tool, e.g. Puppet to distribute and ensure continued compliance

• File sync tool, e.g. rsync

40

Other VMware Activities Related to This Session

HOL:

HOL-SDC-1305

Business Continuity and Disaster Recovery In Action

Group Discussions:

BCO1003-GD

Disaster Recovery and Replication with Ken Werneburg

THANK YOU

Three Quirky Ways to Simplify DR with

Site Recovery Manager

Ben Meadowcroft, VMware

BCO5652

#BCO5652