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
Free Learning
Arrow right icon
PowerCLI Cookbook
PowerCLI Cookbook

PowerCLI Cookbook: Over 75 step-by-step recipes to put PowerCLI into action for efficient administration of your virtual environment

Arrow left icon
Profile Icon Philip Brandon Sellers
Arrow right icon
$29.99 $43.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.8 (4 Ratings)
eBook Mar 2015 274 pages 1st Edition
eBook
$29.99 $43.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m
Arrow left icon
Profile Icon Philip Brandon Sellers
Arrow right icon
$29.99 $43.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.8 (4 Ratings)
eBook Mar 2015 274 pages 1st Edition
eBook
$29.99 $43.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m
eBook
$29.99 $43.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

PowerCLI Cookbook

Chapter 2. Configuring vCenter and Computing Clusters

In this chapter, you will cover the following topics:

  • Creating a virtual datacenter in vCenter
  • Creating a cluster and adding ESXi hosts
  • Setting cluster advanced features, including HA, DRS, and EVC
  • Setting up resource pools
  • Setting up folders to organize objects in vCenter
  • Setting permissions on vCenter objects

Introduction

A single ESXi host allows you to run multiple virtual machines on a single server, but to tap the full potential of power from vSphere, you're going to need vCenter and clusters of ESXi hosts. This chapter will cover the basic concepts of creating and managing pools of resources using vCenter and multiple ESXi hosts.

vCenter is an increasingly critical part of the vSphere infrastructure since it handles the coordination of clustering and automation across multiple ESXi hosts. This drives the change and increases the complexity of vCenter deployments in each new version of vSphere. Even while the vCenter deployments are becoming more complex, VMware is working to try and ease that management by packaging the solution in simpler ways. vSphere 5.1 introduced the new Single Sign-On (SSO) service to the platform, and vSphere 5.5 streamlined deployment of the SSO's second version in vSphere. vSphere 5.5 also improved the virtual appliance version of vCenter, known as the...

Creating a virtual datacenter in vCenter

vSphere has several defined objects that are used to create virtual datacenters. For example, an object named Datacenter sits at the root of vSphere and allows the clusters and other host infrastructures to be placed inside the virtual datacenter. Installations might have multiple datacenters; however, most VMware administrators use additional datacenter objects in vSphere to represent a physical site and use the datacenter object as a boundary where the infrastructure exists. In this recipe, you will take a look at the code needed to create your new datacenter object in vCenter.

Getting ready

For this recipe, you will need to open a PowerCLI prompt, you need the DNS name or IP address of your vCenter host, and the password for the default administrator account in vCenter.

How to do it…

In order to create a virtual datacenter, and to create new datacenter object in vCenter, perform the following steps:

  1. The first step is to connect to your vCenter...

Creating a cluster and adding ESXi hosts

Clusters are the basis for everything that is great within vSphere. Clusters are the level where individual resources become pooled and shared for virtual machines. Clusters allow all higher-level functionalities within vSphere, such as an automatic restart after a hardware failure and dynamic balancing of workloads. Individual ESXi hosts and clusters can exist at the same level under a datacenter object in vSphere.

In this recipe, you will walk through the steps necessary to set up your first cluster of servers in vCenter. You will be reusing the same four ESXi hosts that you configured in the Creating a configuration script to set all properties uniformly recipe from Chapter 1, Configuring the Basic Settings of an ESXi Host with PowerCLI.

Getting ready

This chapter assumes that your vCenter has the datacenter object defined and that you have individual ESXi hosts connected or managed by vCenter. In this example, you will call the Primary datacenter...

Setting cluster advanced features, including HA, DRS, and EVC

The previous recipe mentioned the advanced features of vSphere clusters. In this recipe, you will configure those advanced features since it is more common to reconfigure these settings than to initially set these settings.

The cluster settings you are going to be working with are HA, DRS, and Enhanced vMotion Compatibility (EVC) settings. In the vSphere Client, these settings are exposed in the Edit Cluster Settings option.

Creating a cluster is a one-time event, but as you deploy vSphere, you might not be ready to automate vMotions or Storage vMotions with DRS in your cluster from the beginning.

However, over a period of time, your comfort level with these automation technologies begins to increase and you would want to put the cluster on autopilot and change the automation level to be fully automated. You will cover how to do this and how to set up other common settings from PowerCLI.

PowerCLI is useful for these settings because...

Setting up resource pools

Resource pools are objects within vSphere where VM objects with similar performance requirements can be grouped together. Resource pools allow a priority to be set to pools of compute, memory, and disk resources, so that when the contention occurs, the hypervisor can choose which VMs get access to resources first. Resource pools exist within the cluster objects in vSphere or within host objects if a host is not a part of a cluster.

Getting ready

To begin this recipe, you will need to open a PowerCLI window and connect to a vCenter server. For the purpose of this example, we're going to configure two resource pools: Production and Development. The Production resource pool will be configured with the high setting for CPU and memory resources. The Development resource pool will be configured with the low setting for CPU and memory resources.

Sometimes, PowerCLI defines its normal conventions and resource pools is one of them. You can't simply pass a cluster...

Introduction


A single ESXi host allows you to run multiple virtual machines on a single server, but to tap the full potential of power from vSphere, you're going to need vCenter and clusters of ESXi hosts. This chapter will cover the basic concepts of creating and managing pools of resources using vCenter and multiple ESXi hosts.

vCenter is an increasingly critical part of the vSphere infrastructure since it handles the coordination of clustering and automation across multiple ESXi hosts. This drives the change and increases the complexity of vCenter deployments in each new version of vSphere. Even while the vCenter deployments are becoming more complex, VMware is working to try and ease that management by packaging the solution in simpler ways. vSphere 5.1 introduced the new Single Sign-On (SSO) service to the platform, and vSphere 5.5 streamlined deployment of the SSO's second version in vSphere. vSphere 5.5 also improved the virtual appliance version of vCenter, known as the vCenter Server...

Creating a virtual datacenter in vCenter


vSphere has several defined objects that are used to create virtual datacenters. For example, an object named Datacenter sits at the root of vSphere and allows the clusters and other host infrastructures to be placed inside the virtual datacenter. Installations might have multiple datacenters; however, most VMware administrators use additional datacenter objects in vSphere to represent a physical site and use the datacenter object as a boundary where the infrastructure exists. In this recipe, you will take a look at the code needed to create your new datacenter object in vCenter.

Getting ready

For this recipe, you will need to open a PowerCLI prompt, you need the DNS name or IP address of your vCenter host, and the password for the default administrator account in vCenter.

How to do it…

In order to create a virtual datacenter, and to create new datacenter object in vCenter, perform the following steps:

  1. The first step is to connect to your vCenter server...

Left arrow icon Right arrow icon

Description

If you are a virtualization professional who wants to unleash the power of automation and combat the complexity of sprawling virtual environments, this book is ideal for you. This book will enhance your skills of administering VMware vSphere and vCloud Director with PowerCLI.

What you will learn

  • Configure and administer VMware ESXi hosts, clusters, and vCenter Manage virtual machine configurations and operations Administer datastores, datastore clusters, and virtual machine snapshots Create and configure virtual networking in a vSphere environment Manage cluster features and affinity groups Make custom reports and notifications from vSphere Direct operations in vCloud Director

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Mar 25, 2015
Length: 274 pages
Edition : 1st
Language : English
ISBN-13 : 9781784391065
Vendor :
Microsoft
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Mar 25, 2015
Length: 274 pages
Edition : 1st
Language : English
ISBN-13 : 9781784391065
Vendor :
Microsoft
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 164.97
Learning PowerCLI for VMware VSphere
$48.99
Mastering PowerCLI
$60.99
PowerCLI Cookbook
$54.99
Total $ 164.97 Stars icon
Banner background image

Table of Contents

12 Chapters
1. Configuring the Basic Settings of an ESXi Host with PowerCLI Chevron down icon Chevron up icon
2. Configuring vCenter and Computing Clusters Chevron down icon Chevron up icon
3. Managing Virtual Machines Chevron down icon Chevron up icon
4. Working with Datastores and Datastore Clusters Chevron down icon Chevron up icon
5. Creating and Managing Snapshots Chevron down icon Chevron up icon
6. Managing Resource Pools, Reservations, and Limits for Virtual Machines Chevron down icon Chevron up icon
7. Creating Custom Reports and Notifications for vSphere Chevron down icon Chevron up icon
8. Performing ESXCLI and in-guest Commands from PowerCLI Chevron down icon Chevron up icon
9. Managing DRS and Affinity Groups using PowerCLI Chevron down icon Chevron up icon
10. Working with vCloud Director from PowerCLI Chevron down icon Chevron up icon
A. Setting up and Configuring vCloud Director Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.8
(4 Ratings)
5 star 75%
4 star 25%
3 star 0%
2 star 0%
1 star 0%
Chris Wahl Apr 19, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
One of the more difficult parts of learning PowerCLI - and PowerShell itself - is determining where to get started. I often suggest identifying a project or task that you want to complete, and then figuring out how to do it, because aimlessly fiddling with a language can be frustrating. If you're looking for a library of sample code that walks you through the why and how, I'd suggest picking up the PowerCLI Cookbook written by Philip Sellers.The book is published through Packt Publishing, who's library contains material that wildly varies across the quality spectrum. However, it is obvious that Philip put a large quantity of time, effort, and care into this book and offers over 200 pages of in-depth discussion and examples for automating a wide swath of data center activities.Each walk-through is arranged into a recipe, containing details on what will be required to follow along with the recipe, steps required to build the code, details on why the code is setup the way it is (and how to modify it for your own purposes). The author has frequently added additional reading to the recipes with blog links, documentation, KBs, and other handy resources.Of note, Philip has built a fairly robust set method for balancing share allocations and resource pools using some of my older work as a baseline. Don't worry, he pinged me about it before it made it into the book, but his approach of using a custom attributes (page 140) is refreshing and looks solid. He even writes a proper function whereas my code was just a spitball idea.There's also an entire section on snapshot management (page 107) with the steps necessary to build a snapshot management module (page 129). I've talked about PowerShell modules recently, and it's spectacular to see examples on building custom modules in this book. Philip offers ideas around naming of snapshots, when to quiesce memory, and how to automate / prune the snapshot lifecycle. This is solid stuff.The last thing I'll compliment is the points in the book where Philip goes a bit out of scope of a straight cookbook. For example, on page 78 there's a decent volume of content covering the use of Get-View and how to view properties and methods. That's some pretty advanced stuff, but the writing breaks it down into meaningful and digestible chunks. Having hit the limitation of the native PowerCLI cmdlets frequently, there's definitely a lot of value in knowing how to leverage methods directly.If you're brand new to PowerCLI, or looking to leverage some polished examples to help tickle the noodle on coding ideas, I'd suggest picking up a copy of PowerCLI Cookbook. I read the whole thing over the course of a few plane flights because it was that good.Note: I requested a review copy of the book from the author which was fulfilled by the publisher.
Amazon Verified review Amazon
Earl Waud Apr 06, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I am a virtualization engineer with 9 years of experience creating automation and administration solutions for large corporations.Last year I was contacted by Packt Publishing and asked if I would be interested in providing technical review services for a new book titled PowerCLI Cookbook. It seemed like an excellent opportunity and I quickly agreed.They sent me a draft copy of the book, one chapter at a time. I would review the chapter content for technical accuracy and test each of the chapter’s code samples and downloadable content, and reply with any corrections, my comments and any feedback. I quickly realized that reading a technical book is a lot different than reviewing a technical book. However I still enjoyed the process as It gave me a chance to use (and expand) my skills in a fun new way.Chapter by chapter, I reviewed the book. I found each chapter to be filled with powerful examples, showing ways to simplify and automate the real tasks that vSphere administrators need to do, the real tasks that I need to do. I finished my review of the last chapter back in early November .Well, Packt has finally published the PowerCLI Cookbook.They wanted to give the author time to validate and update the book’s content to include the vSphere 6 feature set.With a published copy in hand, and based on my detailed review of the book’s content, I can tell you with confidence that Philip Sellers has delivered an excellent resource on PowerCLI, and I highly recommend it to anyone looking for such a resource.The book details examples of dozens of highly useful, real world tasks needed for the day-to-day administration of your vSphere environment. The examples are presented in a way that lets your quickly learn to use and adapt them to your needs.Whether you are new to PowerCLI and looking for a book to help you learn and get started, or you are an experienced PowerShell or PowerCLI user looking for a great reference book to help you automate the administration of your virtual environment, you will find this book to be an excellent choice.
Amazon Verified review Amazon
R. Hudson Apr 09, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I’m glad I purchased this book! I’ve already found several topics that I’ve needed to get into my production routine. The book is put together very well with straight forward approaches covering what I and many administrators need every day for administration. Scripting and automation are life savers (no longer optional, but required). I believe I’ve already recouped my investment by just using the recipes presented and I’ve only just begun.
Amazon Verified review Amazon
Vinay Jun 05, 2015
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
A great reference book to help you automate the administration of your virtual environment!! Grab it now....
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.