automating zvr with powershell and rest apis .automating zerto virtual replication with powershell

Download Automating ZVR with PowerShell and REST APIs .Automating Zerto Virtual Replication with PowerShell

Post on 13-Sep-2018

216 views

Category:

Documents

1 download

Embed Size (px)

TRANSCRIPT

  • Automating Zerto Virtual Replication with PowerShell & REST APIs Whitepaper

    VERSION 4.0 MAY 2018

  • AUTOMATING ZVR WITH POWERSHELL & REST API WHITEPAPER 2 OF 134

    Table of Contents

    1 INTRODUCTION .................................................................................................................................................... 4

    1.1 Use Cases .....................................................................................................................................................................4

    1.2 REST APIs .....................................................................................................................................................................4

    1.3 Legal Disclaimer ...........................................................................................................................................................4

    2 BASICS & BEST PRACTICES .................................................................................................................................... 5

    2.1 Requirements ..............................................................................................................................................................5

    2.2 Using Variables & Arrays .............................................................................................................................................5

    2.3 Encrypting Passwords ..................................................................................................................................................6

    2.4 Scripting Best Practices................................................................................................................................................6

    2.5 Transcripts ...................................................................................................................................................................6

    2.6 Loading Modules .........................................................................................................................................................7

    2.7 Bypassing Certificate Warnings ...................................................................................................................................7

    2.8 Establishing API Sessions .............................................................................................................................................8

    2.9 Full Start of Script Example..........................................................................................................................................9

    3 QUERYING & REPORTING ................................................................................................................................... 11

    3.1 Use Cases .................................................................................................................................................................. 11

    3.1 Listing Unprotected VMs .......................................................................................................................................... 11

    3.2 Using Unprotected VM IDs ....................................................................................................................................... 11

    3.3 Listing Protected VMs & VPGs .................................................................................................................................. 12

    3.4 Long Term RPO & Storage Reporting to CSV ............................................................................................................ 13

    3.5 Resource Reports...................................................................................................................................................... 15

    3.6 Resource Report Use Cases ...................................................................................................................................... 17

    3.7 VPG, VM, VDISK, VNIC & Re-IP Settings Report ....................................................................................................... 18

    4 DAILY EMAIL REPORTS........................................................................................................................................ 27

    4.1 Use Cases .................................................................................................................................................................. 27

    4.2 Design Methodology ................................................................................................................................................ 27

    4.3 Daily Email Report .................................................................................................................................................... 27

    5 AUTOMATING DEPLOYMENT ............................................................................................................................. 67

    5.1 Use Cases .................................................................................................................................................................. 67

    5.2 Bulk Automated VRA Deployment ........................................................................................................................... 67

    5.3 Bulk Automated VPG Creation ZVM Only.............................................................................................................. 70

    5.4 Bulk Automated VPG Creation ZVM & ZCM .......................................................................................................... 76

    5.5 Bulk Automated VPG Creation with Boot Groups & Re-IP ZVM Only ................................................................... 82

    6 AUTOMATING VM PROTECTION ........................................................................................................................ 89

    6.1 Use Cases .................................................................................................................................................................. 89

    6.2 Automating VM Protection by vSphere Folder - ZVM Only ..................................................................................... 89

    6.3 Automating VM Protection by vSphere Folder - ZVM & ZCM .................................................................................. 97

    6.4 Automating VM Protection with vRealize Orchestrator ........................................................................................ 104

    6.5 Adding VMs to VPGs ............................................................................................................................................... 105

  • AUTOMATING ZVR WITH POWERSHELL & REST API WHITEPAPER 3 OF 134

    7 BULK EDIT OPERATIONS ................................................................................................................................... 107

    7.1 Bulk VPG Name Changing ....................................................................................................................................... 107

    7.2 Bulk Editing VM NIC Settings Including Re-IP & Port Groups ................................................................................. 111

    8 SCHEDULING OFFSITE CLONES ......................................................................................................................... 119

    8.1 Use Cases ................................................................................................................................................................ 119

    8.2 Design Methodology .............................................................................................................................................. 119

    8.3 Scheduled Offsite Clone ......................................................................................................................................... 120

    9 TROUBLESHOOTING ......................................................................................................................................... 134

  • AUTOMATING ZVR WITH POWERSHELL & REST API WHITEPAPER 4 OF 134

    1 INTRODUCTION

    1.1 Use Cases

    This document gives an overview of how to utilize Zerto Virtual Replication REST APIs with PowerShell to automate your virtual

    infrastructure. In turn, this enables the reduction of manual processes and the realization of the full benefits of software-defined

    replication and recovery. Highlights of key use cases covered within this document include:

    Automating VM protection

    Automating VM protection with vRealize Orchestrator

    Bulk VRA deployment

    Bulk VPG configuration

    Scheduling Offsite Clones

    Daily email reports

    Bulk Re-IP addressing

    Also included is how to obtain reporting on:

    Long term RPO statistics

    VMs by top journal and recovery storage usage

    Protected and unprotected VMs

    VMs by target Hosts for recovery balancing

    VMs by average bandwidth utilization

    VMs by datastore

    VMs by CPU and RAM allocation

    The examples given have been developed to meet the requirements of Zerto cloud and enterprise environments ranging from 100s to

    thousands of VMs. The font size of the examples given are optimized depending on the maximum line length to enable copying and

    pasting directly from the PDF into your PowerShell scripts.

    1.2 REST APIs

    The REST APIs utilized in the exampl

Recommended

View more >