vSphere Management Assistant Guide vSphere 5.0 This document supports the version of each product listed and supports all subsequent versions until the document is replaced by a new edition. To check for more recent editions of this document, see http://www.vmware.com/support/pubs.
vSphere Management Assistant 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 © 2008–2011 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws.
Contents About This Book 5 1 Introduction to vMA 7 vMA Capabilities 7 vMA Component Overview 8 vSphere Authentication Mechanism 8 vMA Samples 9 vMA Use Cases 9 Writing or Converting Scripts 9 Writing or Converting Agents 9 2 Getting Started with vMA 11 Hardware Requirements 12 Software Requirements 12 Required Authentication Information 12 Deploy vMA 13 Configure vMA at First Boot 13 vMA Console and Web UI 14 Configure vMA for Active Directory Authentication 14 Configure Unattended Authentication for Ac
vSphere Management Assistant Guide vifp Target Management Commands 28 vifp addserver 28 vifp removeserver 29 vifp rotatepassword 30 vifp listservers 31 vifp reconfigure 32 Target Management Example Sequence 32 Using the VmaTargetLib Library 33 VmaTargetLib Reference 33 Enumerating Targets 33 Querying Targets 33 Programmatic Login 34 Programmatic Logout 34 Index 35 4 VMware, Inc.
About This Book The vSphere Management Assistant Guide explains how to deploy and use vMA and includes reference information for vMA CLIs and libraries. To view the current version of this book, as well as all VMware API and SDK documentation, go to http://www.vmware.com/support/pubs/sdk_pubs.html. NOTE The topics in which this documentation uses the product name ʺESXiʺ are applicable to all supported releases of ESX and ESXi.
vSphere Management Assistant Guide Document Feedback VMware welcomes your suggestions for improving our documentation. 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 versions of other VMware books, go to http://www.vmware.com/support/pubs.
1 Introduction to vMA 1 The vSphere Management Assistant (vMA) is a SUSE Linux Enterprise Server 11‐based virtual machine that includes prepackaged software such as the vSphere command‐line interface, and the vSphere SDK for Perl. vMA allows administrators to run scripts or agents that interact with ESXi hosts and vCenter Server systems without having to authenticate each time.
vSphere Management Assistant Guide vMA Component Overview When you install vMA, you are licensed to use the virtual machine that includes all vMA components. vMA includes the following components. SUSE Linux Enterprise Server 11 SP1 – vMA runs SUSE Linux Enterprise Server on the virtual machine. You can move files between the ESXi host and the vMA console by using the vifs vSphere CLI command. VMware Tools – Interface to the hypervisor.
Chapter 1 Introduction to vMA vMA Samples vMA samples illustrate the vMA CLIs and the VmaTargetLib library. The samples are available in vMA at /opt/vmware/vma/samples. bulkAddServers.pl – Perl sample that adds multiple targets to vMA. mcli.pl – Perl sample that runs a vSphere CLI command on multiple vMA targets specified in a file supplied as an argument. You must run vifptarget before running this script. listTargets.
vSphere Management Assistant Guide 10 VMware, Inc.
2 Getting Started with vMA 2 You should have some experience setting up a Linux system and working in a Linux environment. This chapter explains how to deploy and configure vMA, how to add and remove target servers, and how to prepare and run scripts. The chapter also includes troubleshooting information. Read Chapter 1, “Introduction to vMA,” on page 7 for background information on vMA functionality and available vMA components. IMPORTANT You cannot upgrade a previous version of vMA to vMA 5.0.
vSphere Management Assistant Guide “Update vMA” on page 24 “Configure Automatic vMA Updates” on page 25 Hardware Requirements To set up vMA, you must have an ESXi host. Because vMA runs a 64‐bit Linux guest operating system, the ESXi host on which it runs must support 64‐bit virtual machines. The ESXi host must have one of the following CPUs: AMD Opteron, rev E or later Intel processors with EM64T support with VT enabled.
Chapter 2 Getting Started with vMA Deploy vMA You can deploy vMA by using a file or from a URL. If you want to deploy from a file, download and unzip the vMA ZIP file before you start the deployment process. IMPORTANT You cannot upgrade an earlier version of vMA to vMA 5.0. You must install a fresh vMA 5.0 instance. To deploy vMA 1 Use a vSphere Client to connect to a system that is running the supported version of ESXi or vCenter Server.
vSphere Management Assistant Guide 4 When prompted, specify a host name for vMA. The name can contain 64 alphanumeric characters. You can change the vMA host name later by modifying the /etc/HOSTNAME and /etc/hosts files, as you would for a Linux host. You can also use the vMA console to change the host name. For a DHCP configuration, the host name is obtained from the DNS server. 5 When prompted, specify a password for the vi‐admin user. If prompted for an old password, press Enter and continue.
Chapter 2 Getting Started with vMA To add vMA to a domain 1 From the vMA console, run the following command: sudo domainjoin-cli join 2 When prompted, provide the Active Directory administratorʹs password. On successful authentication, the command adds vMA as a member of the domain. The command also adds entries in the /etc/hosts file with vmaHostname.domainname. 3 Restart vMA. Now, you can add an Active Directory target to vMA.
vSphere Management Assistant Guide Troubleshooting Unattended Authentication If you are not able to authenticate from vMA or cannot add vMA to the domain controller, verify the following conditions: Your DNS server setup in vMA resolves the IP address or host name of the vCenter server to a fully qualified domain name (FQDN) and that the FQDN contains the domain name to which vMA is added.
Chapter 2 Getting Started with vMA Add Target Servers to vMA After you configure vMA, you can add target servers that run the supported vCenter Server or ESXi version. For vCenter Server and ESXi system targets, you must have the name and password of a user who can connect to that system. See “vifp addserver” on page 28 for the complete syntax. To add a vCenter Server system as a vMA target for Active Directory Authentication 1 Log in to vMA as vi‐admin.
vSphere Management Assistant Guide 6 Verify that the target server has been added. The display shows all target servers and the authentication policy used for each target. vifp listservers --long server1.mycomp.com server2.mycomp.com server3.mycomp.com vc1.mycomp.com vc2.mycomp.com 7 ESX ESX ESXi vCenter vCenter adauth fpauth adauth adauth fpauth Set the target as the default for the current session.
Chapter 2 Getting Started with vMA Running vSphere CLI for the Targets If you have added multiple target servers, by default, vMA executes commands on the first server that you added. You should specify the server explicitly when running commands. To run vSphere CLI for the targets 1 Add servers as vMA targets. vifp addserver vifp addserver 2 Verify that the target server has been added: vifp listservers 3 Run vifptarget.
vSphere Management Assistant Guide Example 2-1. Adding and Reconfiguring a Target vi-admin@example-dhcp:~> vifp addserver 90.100.110.120 Enter username for 90.100.110.120: administrator administrator@90.100.110.120's password: This will store username and password in credential store which is a security risk. Do you want to continue?(yes/no): yes vi-admin@example-dhcp:~> vifp reconfigure 90.100.110.120 administrator@90.100.110.
Chapter 2 Getting Started with vMA Table 2‐2 lists the vMA components that you can use for modifying scripts that include proc nodes and Linux commands. Table 2-2. vMA Components for Use in Scripts vMA Component Description For more information vSphere CLI commands Manage ESXi hosts and virtual machines. vSphere Command‐Line Interface Installation and Reference Guide. vifs vSphere CLI command Perform common operations, such as copy, remove, get, and put, on files and directories.
vSphere Management Assistant Guide Configure a Static IP Address from the Web UI You can configure a static IP address from the vMA console or the web UI. To configure a static IP address from the web UI 1 Log in to the web UI. 2 Open the Network page and click the Address tab. 3 Select the Use the following IP settings option and provide the IP addresses for the following: 4 IP Address Netmask Gateway Preferred DNS Server Alternate DNS Server Host name Click Save Settings.
Chapter 2 Getting Started with vMA Setting the Time Zone from the Console You can set time zone from the console as described here. To set the time zone from the console 1 On the console, select Set Timezone and press Enter. 2 When prompted, select your continent or region and press Enter. 3 When prompted, select your country and press Enter. The screen displays the information that you have selected and the time that will be set. 4 Type 1 if the information is correct. vMA sets the timezone.
vSphere Management Assistant Guide Troubleshooting vMA You can find troubleshooting information for all VMware products in VMware Knowledge Base articles and information about vMA known issues in the release notes. Table 2‐3 explains a few commonly encountered issues that are easily resolved. Table 2-3. Troubleshooting vMA Issue Resolution You can deploy vMA but when you start up the virtual machine, an error occurs.
Chapter 2 Getting Started with vMA 4 Open the Settings tab and then from the Update Repository section, select a repository. 5 Click Check Updates. 6 Click Install Updates. Configure Automatic vMA Updates You can configure automatic download of vMA updates. To configure automatic updates 1 Access the Web UI. 2 Log in as vi‐admin. 3 Click the Update tab and then the Settings tab. 4 Click Automatic check for updates.
vSphere Management Assistant Guide 26 VMware, Inc.
3 3 vMA Interfaces vMA interfaces allow you to initialize vi‐fastpass, add, remove, and list target servers, and manage passwords. The interfaces are available as Perl commands and Java methods.
vSphere Management Assistant Guide Usage vifptarget --set | --clear | --display | --help | -s -c -d -h Description The vifptarget command enables seamless authentication for remote vSphere CLI and vSphere SDK for Perl commands. You can establish multiple servers as target servers, and then call vifptarget once to initialize all servers for vi‐fastpass authentication. You can then run commands against any target server without additional authentication.
Chapter 3 vMA Interfaces Description After a server is added as a vMA target, you must run vifptarget before you run vSphere CLI commands or vSphere SDK for Perl scripts against that system. The system remains a vMA target across vMA reboots, but running vifptarget again is required after each logout. See “vifptarget Command for vi‐fastpass Initialization” on page 27.
vSphere Management Assistant Guide Usage vifp removeserver [--protocol ] [--portnumber ] [--servicepath ] [--username ] [--password ] [--force] Description Run vifp removeserver for each vMA target before you delete the vMA instance. If you do not run vifp removeserver, the vi‐user and vi‐admin users remain on the target server. If you later this server to vMA, vMA creates two more accounts on this server.
Chapter 3 vMA Interfaces Options Option Description now Immediately rotates the password for all servers or a specified server. server ESXi host for which you want to rotate the password. Use --server only with --now. never Never rotate the password for any target server. days Rotate the password for all target servers after the specified number of days. Examples vifp rotatepassword --now Immediately rotates passwords of all ESXi vMA target servers.
vSphere Management Assistant Guide vifp reconfigure Reconfigures target systems. This can be done to change authentication policy or the configured Active Directory user. Usage reconfigure [--authpolicy ] [--protocol ] [--portnumber ] [--servicepath ] [--username ] [--password ] Description You can use this command to reconfigure the authentication policy or the users. This command can be run only by administrators.
Chapter 3 vMA Interfaces Using the VmaTargetLib Library The VmaTargetLib library allows you to programmatically connect to vMA targets by using Perl or Java. Agents can link with VmaTargetLib and use vi‐fastpass functionality. The VmaTargetLib library allows you to enable vi‐fastpass authentication and to query or list one or more targets with the following commands: EnumerateTargets – Retrieves a list of all servers that are vMA targets.
vSphere Management Assistant Guide Programmatic Login Usage Perl VmaTarget.login() Java VmaTarget.login() Description Allows a program to log in to a target server programmatically. Options Option Language Description service Java Java service instance. svcRef Java Java service Managed Object Reference. servername Java, Perl One of the servers added to this vMA instance using vifp addserver. Returns Returns 1 if successful and 0 otherwise. Programmatic Logout Usage Perl VmaTarget.
Index A R adding target servers 17 addserver command 28 authentication component 8 authentication prerequisites 12 removeservers command 29 removing target servers 20 root user account 12 rotatepassword command 30 rotatepassword example 31 C configuring vMA 16 D deleting vMA 23 deploying vMA 13 DNS resolution 24 S scripts, modifying 20 shutting down vMA 23 storage required for vMA 12 sudo 12 T E ESXi systems, vMA target 18 example sequence 32 H hardware prerequisites 12 host name 14 I target serv
vSphere Management Assistant Guide vi-user privileges 16 setup 16 vMA component overview 8 getting started 11 interface overview 27 samples 9 use cases 9 vMA targets ESXi systems 18 vCenter Server systems 17 VmaTargetLib 33 VMware Tools 8 vSphere CLI 8 vSphere SDK for Perl 8 36 VMware, Inc.