Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
VMware vCenter Cookbook

You're reading from   VMware vCenter Cookbook Over 65 hands-on recipes to help you efficiently manage your vSphere environment with VMware vCenter

Arrow left icon
Product type Paperback
Published in May 2015
Publisher Packt
ISBN-13 9781783553976
Length 302 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Kostantin Kuminsky Kostantin Kuminsky
Author Profile Icon Kostantin Kuminsky
Kostantin Kuminsky
Arrow right icon
View More author details
Toc

Table of Contents (9) Chapters Close

Preface 1. vCenter Basic Tasks and Features FREE CHAPTER 2. Increasing Environment Availability 3. Increasing Environment Scalability 4. Improving Environment Efficiency 5. Optimizing Resource Usage 6. Basic Administrative Tasks 7. Improving Environment Manageability Index

Scheduling the VM clone

The vCenter task scheduler discussed in the Automating tasks with scheduler recipe in Chapter 6, Basic Administrative Tasks, allows the automation of a lot of management tasks. At the same time, it has limitations. For example, it does not allow scheduling virtual machine clones, which may be necessary when a copy of a VM is needed.

In this, and similar situations, administrators can use Windows Task Scheduler to run the PowerShell script with PowerCLI commands.

Getting ready

Before creating and testing the following VM deployment script described, make sure that:

  • PowerCLI 5.8 or later is installed on the server, where the script will be executed
  • The user account that will be used has permissions to clone virtual machines

How to do it...

To accomplish the task, we will create the PowerShell script and schedule it in Windows Task Scheduler.

Creating the script

The PowerShell script to clone a VM consists of the following commands:

  1. Define variables used later in this script...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image