vmworld 2013: three quirky ways to simplify dr with vmware site recovery manager

38
Three Quirky Ways to Simplify DR with Site Recovery Manager Ben Meadowcroft, VMware BCO5652 #BCO5652

Upload: vmworld

Post on 05-Dec-2014

87 views

Category:

Technology


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

Page 1: 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

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

3

Agenda

Introduction

SRM Command Steps

SRM Alarms

SRM API

Summary

Questions

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

4

“Three Quirky Ways” – What This Talk is Not

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

5

“Three Quirky Ways” – What This Talk is

How to use some of the

“under-appreciated” SRM

features to help your Disaster

Recovery processes

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

6

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

7

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

8

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

10

Which “under-appreciated” features do you mean?

Command Steps

Events & Alarms

API

1

2

3

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

11

Command Steps

API

1

2

3

Events & Alarms

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

12

Extend Your Recovery Plans

Recover Physical

Workloads

Update DNS

Send Recovery

Notifications

Integrate With

Other Systems

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

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

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

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?

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

15

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

16

1. Call PowerShell Script On SRM Server

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

17

2. Call /bin/sh On Recovered VM

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

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

}

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

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

}

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

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’

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

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

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

22

Command Steps

API

1

2

3

Events & Alarms

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

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

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

24

6 Types of SRM Events

Site Status

vSphere

Replication

Protection Group Storage and

Storage Provider

Permissions &

Licensing

Recovery

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

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

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

26

Email

Scripts

SNMP

What can

I do with

SRM alarms?

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

28

“Known Unknowns”

“Known Knowns”

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

29

Command Steps

API

1

2

3

Events & Alarms

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

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

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

31

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

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.

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

33

SRM API – Key Takeaways

Introspect & Protect:

•Protection Group Information

•Recovery History

•Configure VMs for protection

Initiate:

•Failover

•Test

•Cancel

•Revert

•Reprotect

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

34

Command Steps

Events & Alarms

API

1

2

3

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

37

Questions

github.com/benmeadowcroft/BCO5652

@BenMeadowcroft benmeadowcroft.com

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

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]

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

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

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

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

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

THANK YOU

Page 37: VMworld 2013: Three Quirky Ways to Simplify DR with VMware Site Recovery Manager
Page 38: 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