vcenter Update Manager PowerCLI Installation and Administration Guide vcenter Update Manager PowerCLI 4.1 EN

Similar documents
VMware vsphere Update Manager PowerCLI Installation and Administration Guide Update Manager PowerCLI 6.0 EN

vsphere PowerCLI Installation Guide VMware vsphere PowerCLI 4.1 Update 1 EN

Lifecycle Manager User's Guide

Using the vcenter Orchestrator Plug-In for vcenter Update Manager

Request Manager User's Guide

VMware vcenter Configuration Manager and VMware vcenter Application Discovery Manager Integration Guide

VMware View Upgrade Guide

VMware Infrastructure 3 Primer Update 2 and later for ESX Server 3.5, ESX Server 3i version 3.5, VirtualCenter 2.5

vcenter Chargeback User s Guide

VMware vcenter AppSpeed User s Guide AppSpeed 1.0 EN

vsphere Guest Programming Guide VMware vsphere Guest SDK 4.0

PostgreSQL Solution 1.1

VMware vcenter Discovered Machines Import Tool User's Guide Version for vcenter Configuration Manager 5.6

Installing and Administering VMware vsphere Update Manager. Update 2 VMware vsphere 5.5 vsphere Update Manager 5.5

vcenter CapacityIQ Installation Guide

vsphere Upgrade Guide

VMware vcenter AppSpeed Installation and Upgrade Guide AppSpeed 1.2

vsphere Update Manager Installation and Administration Guide 17 APR 2018 VMware vsphere 6.7 vsphere Update Manager 6.7

Getting Started with ESXi Embedded

Installing and Configuring vcenter Multi-Hypervisor Manager

vcenter CapacityIQ Installation Guide

vrealize Operations Compliance Pack for PCI

Reconfiguring VMware vsphere Update Manager. 17 APR 2018 VMware vsphere 6.7 vsphere Update Manager 6.7

Reconfiguring VMware vsphere Update Manager. Update 1 VMware vsphere 6.5 vsphere Update Manager 6.5

Compatibility Matrixes for VMware vcenter Site Recovery Manager 4.0 and Later

VMware Skyline Collector Installation and Configuration Guide. VMware Skyline 1.4

Using vrealize Operations Tenant App as a Service Provider

Installing and Configuring vcloud Connector

VMware vrealize Configuration Manager Backup and Disaster Recovery Guide vrealize Configuration Manager 5.8

Installing and Configuring vcenter Support Assistant

vsphere Basic System Administration

vsphere Basic System Administration

vsphere Datacenter Administration Guide

IT Systems Integration

QuickStart Guide vcenter Server Heartbeat 5.5 Update 1 EN

Application Discovery Manager User s Guide vcenter Application Discovery Manager 6.2.2

vsphere SDK for Perl Installation Guide vsphere 4.0 EN

Developing and Deploying vsphere Solutions, vservices, and ESX Agents

vsphere Web Client Extensions Programming Guide vsphere 5.1

VMware vfabric Data Director Installation Guide

VMware vcenter Configuration Manager Administration Guide vcenter Configuration Manager 5.7

Using the vcenter Orchestrator Perspectives Plug-In

vshield Quick Start Guide

Virtual Infrastructure Web Access Administrator s Guide Update 2 and later for ESX Server 3.5 and VirtualCenter 2.5

Upgrade Guide. vcloud Availability for vcloud Director 2.0

vrealize Network Insight Installation Guide

Installing vrealize Network Insight

vcenter Orchestrator Installation and Configuration Guide

vcenter Server Installation and Setup Modified on 11 MAY 2018 VMware vsphere 6.7 vcenter Server 6.7

VMWARE VSPHERE FEATURE COMPARISON

vsphere Client Hardware Health Monitoring VMware vsphere 4.1

VMware vsphere 5.0 Evaluation Guide

VMware vfabric Data Director Installation Guide

vcenter Server Heartbeat Administrator's Guide VMware vcenter Server Heartbeat 6.6 Update 2

Installing and Configuring vcloud Connector

Installing vrealize Network Insight. VMware vrealize Network Insight 3.3

VMware App Volumes Installation Guide. VMware App Volumes 2.13

VMware Skyline Collector Installation and Configuration Guide. VMware Skyline Collector 2.0

vsphere Availability Guide

What Is New in VMware vcenter Server 4 W H I T E P A P E R

Configuration Maximums VMware vsphere 5.0

vcenter Orchestrator Administration Guide

vcenter Chargeback API Programming Guide vcenter Chargeback 1.0.1

Deploying VMware Identity Manager in the DMZ. JULY 2018 VMware Identity Manager 3.2

Getting Started with ESX Server 3i Installable Update 2 and later for ESX Server 3i version 3.5 Installable and VirtualCenter 2.5

Getting Started with VMware View View 3.1

Infrastructure Navigator User's Guide

VMware vrealize Operations for Horizon Installation

Site Recovery Manager Administration. Site Recovery Manager 6.1

Using vrealize Operations Tenant App for vcloud Director as a Tenant Admin

Administering Cloud Pod Architecture in Horizon 7. Modified on 4 JAN 2018 VMware Horizon 7 7.4

vsphere Upgrade Update 2 Modified on 4 OCT 2017 VMware vsphere 6.0 VMware ESXi 6.0 vcenter Server 6.0

VMware Horizon Migration Tool User Guide

VMware vrealize Operations Federation Management Pack 1.0. vrealize Operations Manager

Programming Guide Guest SDK 3.5

Using the vcenter Orchestrator SOAP Plug-In 1.0.1

VMware vrealize Operations for Horizon Installation. VMware vrealize Operations for Horizon 6.3

Virtual Infrastructure Web Access Administrator s Guide ESX Server 3.0 and VirtualCenter 2.0

IaaS Integration for Multi-Machine Services

vcenter Support Assistant User's Guide

Site Recovery Manager Security

vrealize Production Test Upgrade Assessment Guide

vsphere Virtual Machine Administration

Developing and Deploying vsphere Solutions, vservices, and ESX Agents

vsphere Upgrade Update 1 Modified on 4 OCT 2017 VMware vsphere 6.5 VMware ESXi 6.5 vcenter Server 6.5

vrealize Network Insight Installation Guide

Using the vcenter Orchestrator Plug-In for vcloud Director 1.0

Deploying VMware Identity Manager in the DMZ. SEPT 2018 VMware Identity Manager 3.3

vrealize Suite Lifecycle Manager 1.0 Installation and Management vrealize Suite 2017

vrealize Operations Management Pack for vsan 1.0 Guide

vcenter Support Assistant User's Guide

VMware vrealize Configuration Manager SQL Migration Helper Tool User's Guide vrealize Configuration Manager 5.8

Unattended Installation on Windows Server 2008/2012

vrealize Automation Management Pack 2.0 Guide

VMware vsphere. Administration VMware Inc. All rights reserved

TECHNICAL WHITE PAPER AUGUST 2017 REVIEWER S GUIDE FOR VIEW IN VMWARE HORIZON 7: INSTALLATION AND CONFIGURATION. VMware Horizon 7 version 7.

IaaS Integration for Multi- Machine Services. vrealize Automation 6.2

vcloud SDK for.net Developer s Guide VMware vcloud SDK 1.0

Using the vrealize Orchestrator Operations Client. vrealize Orchestrator 7.5

Site Recovery Manager Administration. Site Recovery Manager 6.0

Transcription:

vcenter Update Manager PowerCLI Installation and Administration Guide vcenter Update Manager PowerCLI 4.1 EN-000368-00

vcenter Update Manager PowerCLI Installation and Administration Guide You can find the most up-to-date technical documentation on the VMware Web site at: http://www.vmware.com/support/ The VMware Web site also provides the latest product updates. If you have comments about this documentation, submit your feedback to: docfeedback@vmware.com Copyright 2010 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents. VMware is a registered trademark or trademark of VMware, Inc. in the United States and/or other jurisdictions. All other marks and names mentioned herein may be trademarks of their respective companies. VMware, Inc. 3401 Hillview Ave. Palo Alto, CA 94304 www.vmware.com 2 VMware, Inc.

Contents About This Book 5 Installing and Using vcenter Update Manager PowerCLI 7 Installing vcenter Update Manager PowerCLI 7 Supported Platforms 7 Prerequisites 8 Install vcenter Update Manager PowerCLI 8 Uninstalling vcenter Update Manager PowerCLI 8 Using vcenter Update Manager PowerCLI 8 Getting Started with vcenter Update Manager PowerCLI 8 Connecting to a vcenter Server 9 Examples of Usage of vcenter Update Manager PowerCLI Cmdlets 9 Creating Patch Baselines 9 Attaching and Detaching Baselines 9 Scanning a Virtual Machine 10 Staging Patches 10 Remediating Inventory Objects 11 Downloading Patches and Scanning Objects 12 VMware, Inc. 3

vcenter Update Manager PowerCLI Installation and Administration Guide 4 VMware, Inc.

About This Book The vcenter Update Manager PowerCLI Installation and Administration Guide, provides information about installing and using the vcenter Update Manager PowerCLI 4.1. The Update Manager PowerCLI contains cmdlets for managing software patches and baselines, and scanning and remediating virtual machines and hosts. Intended Audience This book is intended for administrators who need to install and use vcenter Update Manager PowerCLI 4.1. NOTE All vcenter Update Manager PowerCLI users are expected to be familiar with the VMware vsphere PowerCLI cmdlets, VMware vsphere administration, VMware vcenter Update Manager, and the Windows operating system. For more information about the functionality of vcenter Update Manager, see the vcenter Update Manager Administration Guide. VMware Technical Publications Glossary VMware Technical Publications provides a glossary of terms that might be unfamiliar to you. For definitions of terms as they are used in VMware technical documentation go to http://www.vmware.com/support/pubs. Document Feedback VMware welcomes your suggestions for improving our documentation. If you have comments, send your feedback to docfeedback@vmware.com. Technical Support and Education Resources The following sections describe the technical support resources available to you. To access the current version of this book and other books, go to http://www.vmware.com/support/pubs. Online and Telephone Support To use online support to submit technical support requests, view your product and contract information, and register your products, go to http://www.vmware.com/support. Customers with appropriate support contracts should use telephone support for the fastest response on priority 1 issues. Go to http://www.vmware.com/support/phone_support.html. Support Offerings To find out how VMware support offerings can help meet your business needs, go to http://www.vmware.com/support/services. VMware, Inc. 5

vcenter Update Manager PowerCLI Installation and Administration Guide VMware Professional Services VMware Education Services courses offer extensive hands-on labs, case study examples, and course materials designed to be used as on-the-job reference tools. Courses are available onsite, in the classroom, and live online. For onsite pilot programs and implementation best practices, VMware Consulting Services provides offerings to help you assess, plan, build, and manage your virtual environment. To access information about education classes, certification programs, and consulting services, go to http://www.vmware.com/services. 6 VMware, Inc.

Installing and Using vcenter Update Manager PowerCLI The VMware vcenter Update Manager PowerCLI provides a set of cmdlets for downloading software patches, creating and modifying baselines, and for scanning and remediating virtual machines or hosts. These cmdlets are stored in the VMware.VumAutomation plug-in, and are available through the VMware vsphere PowerCLI console. The chapter includes the following topics: Installing vcenter Update Manager PowerCLI on page 7 Using vcenter Update Manager PowerCLI on page 8 Installing vcenter Update Manager PowerCLI You can install and use vcenter Update Manager PowerCLI on machines that have VMware vsphere PowerCLI installed and have access to a vcenter Server system. You can install Update Manager PowerCLI on a machine that does not have vcenter Update Manager or vcenter Server installed. This section provides information about the following topics: Supported Platforms on page 7 Prerequisites on page 8 Install vcenter Update Manager PowerCLI on page 8 Uninstalling vcenter Update Manager PowerCLI on page 8 NOTE To install vcenter Update Manager PowerCLI, you must have vsphere PowerCLI installed on the target machine. To obtain the vsphere PowerCLI package, go to the vsphere PowerCLI download page. Supported Platforms vcenter Update Manager PowerCLI 4.1 is supported on the 32-bit and 64-bit versions of the following Windows operating systems: Windows 7 Windows Server 2008 Windows Vista Windows XP Service Pack 2 Windows Server 2003 Service Pack 2 VMware, Inc. 7

vcenter Update Manager PowerCLI Installation and Administration Guide Prerequisites To install and use vcenter Update Manager PowerCLI 4.1, you must have the following software installed on the target machine:.net 2.0 SP1 Windows PowerShell 1.0 or higher VMware vsphere PowerCLI 4.1 NOTE Update Manager PowerCLI 4.1 works only with vcenter Update Manager 4.1. Install vcenter Update Manager PowerCLI You can download the vcenter Update Manager PowerCLI installer package from the vcenter Update Manager section on the SDK and API download page at http://communities.vmware.com/community/developer/downloads. To install the vcenter Update Manager PowerCLI 1 Start the vcenter Update Manager PowerCLI installer. 2 Click Next in the Welcome page to continue with the installation. 3 Read and accept the license agreement terms. 4 Click Install. 5 Click Finish to complete the installation process. Uninstalling vcenter Update Manager PowerCLI To uninstall the vcenter Update Manager PowerCLI from your Windows system, you can use the Add or Remove Programs utility. Using vcenter Update Manager PowerCLI This section explores the basics of the Update Manager PowerCLI cmdlets usage. It discusses the following topics: Getting Started with vcenter Update Manager PowerCLI on page 8 Examples of Usage of vcenter Update Manager PowerCLI Cmdlets on page 9 Getting Started with vcenter Update Manager PowerCLI To get started with vcenter Update Manager PowerCLI, open the vsphere PowerCLI console from the Windows Start menu or by clicking the vsphere PowerCLI shortcut icon. You can get a list of all vcenter Update Manager PowerCLI cmdlets by running the Get-Command command with the -PSSnapin parameter: Get-Command -PSSnapin VMware.VumAutomation NOTE You can check the version number of the installed vcenter Update Manager PowerCLI by running the following command: Get-PSSnapin "VMware.VumAutomation" fl -Property Version To find information on a specific cmdlet, run the Get-Help cmdlet with the cmdlet name. For example: Get-Help Get-Patch 8 VMware, Inc.

Installing and Using vcenter Update Manager PowerCLI Connecting to a vcenter Server Connect to a vcenter Server that has a vcenter Update Manager server installed on it. To connect to a vcenter Server 1 Run Connect-VIServer and provide the server DNS or IP address: Connect-VIServer 10.23.112.234 2 When prompted, provide a user name and password to authenticate. Examples of Usage of vcenter Update Manager PowerCLI Cmdlets The following examples demonstrate the basic usage of the vcenter Update Manager PowerCLI cmdlets. The examples contain vsphere PowerCLI cmdlets for retrieving and managing vsphere objects. To implement the examples code, you must have an existing vsphere infrastructure. Creating Patch Baselines Patch baselines can be applied to either hosts or virtual machines. Depending on the patch criteria you select, patch baselines can be either dynamic or fixed (static). Patch data in dynamic baselines changes depending on the criteria you specify each time Update Manager downloads new patches. Fixed baselines contain only the patches you have selected, regardless of new patch downloads. To create patch baselines 1 Retrieve all virtual machine patches released after 1st January 2009 for Windows XP, and create a fixed baseline named Static Baseline, containing the retrieved patches: $patches = Get-Patch -After "1 Jan 2009" -Product Windows XP (x64) -TargetType VM The -TargetType parameter specifies the object types to which a baseline is applicable. The valid values are VM for VirtualMachine objects and VMHost for Host objects. $staticbaseline = New-PatchBaseline -Static -Name "Static Baseline" -IncludePatch $patches -TargetType VM 2 Create a critical dynamic baseline named Dynamic Baseline by using a fetch-all query: $criticalpatchbaseline = New-PatchBaseline -Dynamic -Name "Dynamic Baseline" -TargetType VM -SearchPatchSeverity Critical 3 Create an extension baseline that contains all available extensions: $extensions = Get-Patch -BundleType Extension New-PatchBaseline -Static -Name "Extension Baseline" -Extension -TargetType Host -IncludePatch $extensions Attaching and Detaching Baselines Attach baselines to individual objects and to container objects, such as folders, hosts, clusters, and datacenters. Attaching a baseline to a container object transitively attaches the baseline to all objects in the container. To attach and detach baselines 1 Attach the virtual machine patch baselines stored in the provided variables to the virtual machine named VM: Attach-Baseline -Baseline $staticbaseline, $criticalpatchbaseline -Entity VM 2 Detach the two baselines from the virtual machine: Detach-Baseline -Baseline $dynamicbaseline, $staticbaseline -Entity VM VMware, Inc. 9

vcenter Update Manager PowerCLI Installation and Administration Guide Scanning a Virtual Machine Scan a virtual machine against the baselines attached to it or inherited by its parent object. To create a task for scanning a virtual machine 1 Initialize scanning on a virtual machine named VM against baselines containing virtual machine hardware upgrades and VMware Tools upgrades: $task = Scan-Inventory VM -UpdateType VmHardwareUpgrade, VmToolsUpgrade -RunAsync The command initializes a task on the server, returns a snapshot object of the initial state of the task, and saves it in the $task variable. 2 View the initial status of the scanning task: $task NOTE The task object is not updated with the actual state of the task process running on the server. Even after the task is completed, the $task variable value is running. To view the actual status of the tasks running on the server, use the Get-Task cmdlet. 3 (Optional) Run the Wait-Task cmdlet to watch online the process progress and wait for the task to complete before running other commands: Wait-Task -Task $task To verify whether a virtual machine has at least one baseline with Unknown compliance status attached to it and start a scan 1 Retrieve the compliance statuses with the value Unknown for the baselines attached to the VM virtual machine and store them in a variable: $statuses = Get-Compliance -Entity VM -ComplianceStatus Unknown 2 Verify whether the virtual machine has at least one baseline with Unknown compliance status attached to it and start a scan: if ($statuses.count -gt 0) { Scan-Inventory -Entity VM -RunAsync" } Staging Patches Staging allows you to download patches and extensions from the Update Manager server to the ESX/ESXi hosts, without applying the patches and extensions immediately. To stage patches for a virtual machine host 1 Retrieve a host and assign it to a variable: $host = Get-VMHost -Name 10.23.112.233 2 Stage the patches for upgrading the host: Stage-Inventory -Entity $host NOTE Staging can be performed only for hosts, clusters, and datacenters. 10 VMware, Inc.

Installing and Using vcenter Update Manager PowerCLI Remediating Inventory Objects You can remediate virtual machines, virtual appliances, clusters, and hosts. To remediate a virtual machine 1 Retrieve all baselines attached to the VM virtual machine: $baselines = Get-Baseline Entity VM 2 Remediate the virtual machine: Remediate-Inventory Entity VM Baseline $baselines To upgrade virtual machine hardware and VMware Tools for all virtual machines in a datacenter 1 Retrieve all virtual machines in the Datacenter datacenter: $vms = Get-VM -Location Datacenter 2 Retrieve all virtual machine upgrade baselines: $ugradebaselines = Get-Baseline -TargetType VM -BaselineType Upgrade 3 Remediate the all virtual machines against the virtual machine upgrade baselines: foreach ($vm in $vms) { Remediate-Inventory -Entity $vm -Baseline $upgradebaselines } To remediate a cluster 1 Retrieve all baselines attached to the Cluster cluster: $baselines = Get-Baseline Entity Cluster 2 Remediate the cluster: Remediate-Inventory Entity Cluster Baseline $baselines -ClusterDisableDistributedPowerManagement ClusterDisableHighAvailability -ClusterDiabelFaultTolerance NOTE Before remediation, you must temporarily disable the Distributed Power Management (DPM), High Availability (HA) admission control, and Fault Tolerance (FT) features of the clusters you want to remediate. After remediation, Update Manager automatically re-enables the disabled features. To remediate a host 1 Retrieve all baselines attached to the Host host: $baselines = Get-Baseline Entity Host 2 Remediate the host: Remediate-Inventory Entity Host Baseline $baselines HostFailureAction Retry HostNumberOfRetries 2 -HostDisableMediaDevices NOTE When remediating a host, you can configure the maintenance mode settings. You can temporarily disable any removable media devices that might prevent the host from entering maintenance mode as well. VMware, Inc. 11

vcenter Update Manager PowerCLI Installation and Administration Guide Downloading Patches and Scanning Objects You can download patches from previously defined location. To start a scan for all entities in a datacenter if new patches are downloaded 1 Retrieve all entities in the Datacenter datacenter and save the result in a variable: $entities = Get-Inventory -Location Datacenter 2 Download all available patches and save the result in a variable: $result = Download-Patch 3 Check if new patches are downloaded and start scanning the entities in Datacenter: if ($result.count > 0) { Scan-Inventory -Entity $entities } 12 VMware, Inc.