Вы находитесь на странице: 1из 12

VM Management Tool User Guide

VM Management Tool User Guide


VM Management Tool version 0.1

Thomson Reuters

Page 1

VM Management Tool User Guide

Content
About This Book ................................................................................................................. 3 Intended Audience ............................................................................................................. 3 Document Feedback .......................................................................................................... 3 Technical Support and Education Resources .................................................................... 3 Using VM Management Tool .............................................................................................. 4 About VM Management Tool ............................................................................................. 4 Features Highlights ............................................................................................................ 4 System requirement for VM Management Tool .................................................................. 4 Supported Operating Systems ........................................................................................... 5 Using VM Management Tool.............................................................................................. 5 Command-Line Options ..................................................................................................... 5 Examples of Using VM Management Tool Usage ............................................................. 9 Turn on a VM ..................................................................................................................... 9 Turn off a VM ..................................................................................................................... 9 Suspend a VM ................................................................................................................... 9 Reset a VM ........................................................................................................................ 9 Shutdown OS in a VM........................................................................................................ 9 Login OS in a VM............................................................................................................... 9 Logout OS in a VM ............................................................................................................ 9 Create a snapshot of a VM .............................................................................................. 10 Revert to a current snapshot of a VM ............................................................................... 10 Revert to a specific snapshot of a VM .............................................................................. 10 Delete a snapshot of a VM ............................................................................................... 10 Delete all snapshots of a VM ........................................................................................... 10 Copy a file from Guest OS of a VM to a client machine .................................................... 10 Copy a file from a client machine to Guest OS of a VM ............................................... 10

Delete a file from Guest OS of a VM ................................................................................ 11 Delete a VM ..................................................................................................................... 11 Execute a program inside Guest OS of a VM ................................................................... 11 Deploy a template on a VM .............................................................................................. 11 Change IP address of Guest OS of a VM......................................................................... 11 Check status of VMs ........................................................................................................ 12

Thomson Reuters

Page 2

VM Management Tool User Guide

About This Book


This VM Management Tool User Guide provides information about how to use VM Management Tool to manage virtual machines to do many features alternatively besides VMware vSphere client.

Intended Audience
This book is intended for anyone who needs to manage a virtual machine. Users typically include people who do software development and testing or work with multiple operating systems or computing environments: system administrators, software developers, QA engineers, and anyone who wants to manage virtual machines using command-line interface.

Document Feedback
I welcome your suggestions for improving my documentation. If you have comments, send your feedback to panat.jongsamakkeethaworn@thomsonreuters.com

Technical Support and Education Resources


The following sections describe the technical support resources available to you.

Thomson Reuters

Page 3

VM Management Tool User Guide

Using VM Management Tool


Virtual Machine Management is very important because you do not have to sit aside in front of the computer using VMware vSphere client tool, but you can just scheduling tool to manage your VMs automatically. VM Management Tool is a commandline utility that enables users to manage virtual machines remotely to and from a wide variety of VMware products. This guide contains the following topics: About VM Management Tool Installing VM Management Tool Using VM Management Tool Examples of Using VM Management Tool Usage

About VM Management Tool


You can use VM Management Tool to manage virtual machines ESX, and ESXi. For example, you can turn on a virtual machine within VMware ESXi and export to OVF, and use VM Management Tool to deploy an OVF package, either within your organization or for distribution to other organizations. OVF facilitates the use of vApps, which consist of preconfigured virtual machines that package applications with the operating system that they require. VM Management Tool 0.1 allows you to manage virtual machines on ESX and ESXi 4.0 and later.

Features Highlights
VM Management Tool 0.1 provides the following key features: Manage basic command on ESX and ESXi Manage as Guest on virtual machine Operating system on ESX and ESXi Deploy templates to ESX and ESXi Check a status of VMs on ESX and ESXi

Change IP address of Guest Windows Operating System on ESX and


ESXi

System requirement for VM Management Tool


Microsoft Windows Operating System Microsoft .Net Framework 2.0

Thomson Reuters

Page 4

VM Management Tool User Guide

Supported Operating Systems


VM Management Tool supports the operating systems shown here: Microsoft Windows 32 bit (x86) and 64 bit (x86_64) Windows XP Windows 2003 Windows Vista Windows 7 Windows 2K8

Using VM Management Tool


VM Management Tool is a commandline utility that manages ESX and ESXi hosts. This section describes how to run and select VM Management Tool options. To run VMware OVF Tool from the command line 1. At the commandline prompt, run the VM Management Tool.
>vmmgmt <server> <username> <password> <VMname> <option>

where <server> is the path to the ESX or ESXi, <username> and <password> are username and password to control ESX and ESXi. <option> sees CommandLine Options for the various options. 2. If you want to specifically manage each option, type them after | in <option>.
>vmmgmt <server> <username> <password> <VMname> <option|argument>

3. To display all options, type vmmgmt help.

Command-Line Options
For every command, you must specify the server, username, and password. Table 1 shows all the commandline options. Some options can be set using the form option|arguments. Many arguments can be enabled. For example: option|argument1&argument2&... For any parameters or arguments, it is suggested that any parameter or argument should be within double quote (argument). For example, (a) > vmmgmt 1.1.1.1 user pass vmname status|poweredOn&suspended
OR (b) > vmmgmt 1.1.1.1 user pass vmname status|poweredOn&suspended

(a) and (b) are working but (b) is more preferable.

Thomson Reuters

Page 5

VM Management Tool User Guide

Table 1. OVF Tool Command-Line Options

Option
on off

Arguments Description
N/A N/A Turn on the VM Turn off the VM

Example
vmmgmt 1.1.1.1 user pass vmname on vmmgmt 1.1.1.1 user pass vmname off vmmgmt 1.1.1.1 user pass vmname suspend vmmgmt 1.1.1.1 user pass vmname reset vmmgmt 1.1.1.1 user pass vmname shutdownGuest|osuser&o spass vmmgmt 1.1.1.1 user pass vmname loginGuest|osuser&ospas s vmmgmt 1.1.1.1 user pass vmname logoutGuest vmmgmt 1.1.1.1 user pass vmname snapshot|name&descripti on

suspend

N/A

Suspend the VM

reset

N/A <username of the OS>&<password of the OS> <username of the OS>&<password of the OS> N/A

Reset the VM Execute shutdown command in Guest OS

shutdownGuest

loginGuest

Login the Guest OS

logoutGuest

Logout the Guest OS

snapshot

<name>&<descript Save a snapshot of ion of the the VM snapshot>

revertcurrentsnapsh ot

N/A

vmmgmt 1.1.1.1 user Revert to the current pass vmname snapshot of the VM
revertcurrentsnapshot

revertsnapshot

<snapshot name>

Revert to the specified snapshot of the VM

deletesnapshots

<snapshot name>

Delete the specified snapshot of the VM

vmmgmt 1.1.1.1 user pass vmname revertsnapshot|snapshotn ame vmmgmt 1.1.1.1 user pass vmname deletesnapshots|snapshot name

Thomson Reuters

Page 6

VM Management Tool User Guide

deleteallsnapshot

N/A

Delete all snapshots of the VM Copy file from Guest VM to Host Machine (You need to put filename and path inside "" (double quote))

vmmgmt 1.1.1.1 user pass vmname deleteallsnapshot vmmgmt 1.1.1.1 user pass "VMname" copyfromGuest|Osuser&O spass&c:\test.txt&c:\test. txt

copyfromGuest

<OSusername>&< OSpassword>&<G uest path\file>&<Host path\file>

copytoGuest

<OSusername>&< OSpassword>&<H ost path\file>&<Guest path\file>

Copy file from Host Machine to Guest VM (You need to put filename and path inside "" (double quote))

vmmgmt 1.1.1.1 user pass "VMname" copytoGuest|Osuser&Osp ass&c:\test.txt&c:\test.txt

deletefromGuest

<OSusername>&< OSpassword>&<G uest path\file>

Delete file from Guest VM (You need to put filename and path inside "" (double quote))

vmmgmt 1.1.1.1 user pass "VMname"


deletefromGuest|Osuser&Os pass&c:\test.txt

deleteVM

N/A

Delete the VM

vmmgmt 1.1.1.1 user pass vmname deleteVM

execute

Execute a specified program in Guest <OSusername>&< OS in VM with OSpassword>&<pr arguments(if no ograminGuest>&< argument, an arguments>&<Tim argument can be eoutInSeconds> blank.) and specific timeout Deploy a template to programatically chosen VM slot available

vmmgmt 1.1.1.1 user pass vmname execute|Osuser&Ospass& program&&60

deploy

<template name>

vmmgmt 1.1.1.1 user pass vmname deploy|template1


Page 7

Thomson Reuters

VM Management Tool User Guide

updateip

Update IPaddress of vmmgmt 1.1.1.1 user the Guest OS in VM pass vmname according to the changeip|updateip vmlist.xml vmmgmt 1.1.1.1 user pass vmname changeip|Osuser&Ospass &1.1.1.2&255.255.255.0&1 .1.1.1&10.10.10.10&10.10. 10.11

changeip

<OSusername>&< OSpassword>&<ip address>&<subnet >&<gateway>&<d ns1>&<dns2>

Change IP address of the Guest OS in VM using parameters in the arguments

N/A

Show all VM status according to vmlist.xml (vmname can be blank)

vmmgmt 1.1.1.1 user pass "" status

status <status1>&<status 2>

Show only VMs that have the same status as in your parameter. (you can input as many status as you want)

vmmgmt 1.1.1.1 user pass "" status|poweredOn

Thomson Reuters

Page 8

VM Management Tool User Guide

Examples of Using VM Management Tool Usage


At the command line, type help to display commands of vmmgmt.exe. In the example of command-lines, <server> is 1.1.1.1, <username> is User, <password> is Pass, and <vmname> is VMname

Turn on a VM
To turn on a virtual machine in ESX or ESXi, type a command like the following:
> vmmgmt 1.1.1.1 user pass vmname on

Turn off a VM
To turn off a virtual machine in ESX or ESXi, type a command like the following:
> vmmgmt 1.1.1.1 user pass vmname off

Suspend a VM
To suspend a virtual machine in ESX or ESXi, type a command like the following:
> vmmgmt 1.1.1.1 user pass vmname suspend

Reset a VM
To reset a virtual machine in ESX or ESXi, type a command like the following:
> vmmgmt 1.1.1.1 user pass vmname reset

Shutdown OS in a VM
To shutdown OS in a virtual machine in ESX or ESXi, type a command like the following:
> vmmgmt 1.1.1.1 user pass vmname shutdownGuest|OSuser&OSpass

Where OSuser and OS password are username and password of the OS.

Login OS in a VM
To login OS in a virtual machine in ESX or ESXi, type a command like the following:
> vmmgmt 1.1.1.1 User Pass VMname loginGuest|OSuser&OSpass

Please note that loginGuest is used to create a session login on network, not the screen on vSphere client.

Logout OS in a VM
To logout OS in a virtual machine in ESX or ESXi, type a command like the following:
> vmmgmt 1.1.1.1 user pass vmname logoutGuest

Please note that logoutGuest is used to disconnect a session login on network, not the screen on vSphere client.

Thomson Reuters

Page 9

VM Management Tool User Guide

Create a snapshot of a VM
To create a snapshot on a virtual machine in ESX or ESXi, type a command like the following:
> vmmgmt 1.1.1.1 user pass vmname snapshot|name&description of the snapshot

Revert to a current snapshot of a VM


To revert to a current snapshot of a virtual machine in ESX or ESXi, type a command like the following:
> vmmgmt 1.1.1.1 user pass vmname revertcurrentsnapshot

Revert to a specific snapshot of a VM


To revert to a specific snapshot of a virtual machine, named snapshot name, in ESX or ESXi, type a command like the following:
> vmmgmt 1.1.1.1 user pass vmname revertsnapshot|snapshot name

Delete a snapshot of a VM
To delete a snapshot of a virtual machine, named snapshot name in ESX or ESXi, type a command like the following:
> vmmgmt 1.1.1.1 user pass vmname deletesnapshot|snapshot name

Delete all snapshots of a VM


To delete all snapshots of a virtual machine in ESX or ESXi, type a command like the following:
> vmmgmt 1.1.1.1 user pass vmname deleteallsnapshots

Copy a file from Guest OS of a VM to a client machine


To copy a file from Guest OS of a virtual machine in ESX or ESXi saving into a client machine, type a command like the following:
> vmmgmt 1.1.1.1 user pass vmname copyfromGuest|OSuser&OSpass&c:\program(Guest).exe&c:\program(Client).exe

Description: It will copy a file program(Guest).exe from Guest OS in drive C: and save it into client machine in drive C: as program(Client).exe

Copy a file from a client machine to Guest OS of a VM


To copy a file from a client machine into Guest OS of a virtual machine in ESX or ESXi, type a command like the following:
> vmmgmt 1.1.1.1 user pass vmname copyfromGuest|OSuser&OSpass&c:\program(Client).exe&c:\program(Guest).exe

Description: It will copy a file program(Client).exe from Client machine in drive C: and save it into Guest OS in drive C: as program(Guest).exe
Thomson Reuters Page 10

VM Management Tool User Guide

Delete a file from Guest OS of a VM


To delete a file from Guest OS of a virtual machine in ESX or ESXi, type a command like the following:
> vmmgmt 1.1.1.1 user pass vmname deletefromGuest|OSuser&OSpass&c:\program(Guest).exe

Description: It will delete a file program(Guest).exe from Guest OS in drive C:

Delete a VM
To delete a virtual machine in ESX or ESXi, type a command like the following:
> vmmgmt 1.1.1.1 user pass vmname deleteVM

Description: It will delete a VM named VMname

Execute a program inside Guest OS of a VM


To execute a program inside Guest OS of a virtual machine in ESX or ESXi, type a command like the following:
> vmmgmt 1.1.1.1 user pass vmname execute|OSuser&OSpass&c:\program(Guest).exe&parameters&60

Description: It will execute program(Guest).exe inside Guest OS in drive C: with the parameter parameters and set timeout as 60 seconds PS, if you blank the timeout, the default timeout is 60 seconds.

Deploy a template on a VM
To deploy a template on a virtual machine in ESX or ESXi, type a command like the following:
> vmmgmt 1.1.1.1 user pass vmname deploy|Template1

Description: It will deploy a specific template Template1 on a automatically chosen free slot.

Change IP address of Guest OS of a VM


To chage IP address of Guest OS of a virtual machine in ESX or ESXi, type a command like the following:
> vmmgmt 1.1.1.1 user pass vmname changeip|updateip

Description: It will change IP address, Subnet, Gateway, DNS1, and DNS2 accordingly to vmlist.xml
> vmmgmt 1.1.1.1 user pass vmname changeip|OSuser&OSpass&10.10.10.10&255.255.255.0&10.10.10.1&10.10.10.250&10.10. 10.251

Description: It will change IP address => 10.10.10.10, Subnet => 255.255.255.0, Gateway => 10.10.10.1, DNS1 => 10.10.10.250, and DNS2 => 10.10.10.251 using OSuser and OSpass to login Guest OS

Thomson Reuters

Page 11

VM Management Tool User Guide

Check status of VMs


To check status of virtual machines in ESX or ESXi, type a command like the following:
> vmmgmt 1.1.1.1 user pass vmname status

Description: Display status of all VMs accordingly to vmlist.xml.


> vmmgmt 1.1.1.1 user pass vmname status|poweredOn&suspended

Description: Display all VMs that have status poweredOn and suspended accordingly to vmlist.xml.

Thomson Reuters

Page 12

Вам также может понравиться