<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:clearspace="http://www.jivesoftware.com/xmlns/clearspace/rss" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>VMware Communities : Document List - Automation Tools</title>
    <link>http://communities.vmware.com/community/vmtn/vsphere/automationtools?view=documents</link>
    <description>Latest Documents in Automation Tools</description>
    <language>en</language>
    <pubDate>Fri, 20 Nov 2009 09:01:55 GMT</pubDate>
    <generator>Clearspace 1.10.12 (http://jivesoftware.com/products/clearspace/)</generator>
    <dc:date>2009-11-20T09:01:55Z</dc:date>
    <dc:language>en</dc:language>
    <item>
      <title>vSphere PowerCLI 4.0 Update 1 Cmdlet Reference</title>
      <link>http://communities.vmware.com/docs/DOC-11350</link>
      <description />
      <category domain="http://communities.vmware.com/tags?communityID=2530">vitoolkit</category>
      <pubDate>Fri, 20 Nov 2009 08:59:10 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-11350</guid>
      <dc:date>2009-11-20T08:59:10Z</dc:date>
      <clearspace:dateToText>5 days, 12 hours ago</clearspace:dateToText>
      <clearspace:replyCount>1</clearspace:replyCount>
    </item>
    <item>
      <title>Getting Started with the vMA (tips/tricks)</title>
      <link>http://communities.vmware.com/docs/DOC-10878</link>
      <description>&lt;b&gt;Author:&lt;/b&gt; William Lam&lt;br /&gt;
&lt;b&gt;Twitter:&lt;/b&gt; &lt;a class="jive-link-external" href="http://twitter.com/lamw"&gt;@lamw&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;Website:&lt;/b&gt; &lt;a class="jive-link-external" href="http://engineering.ucsb.edu/~duonglt/vmware/"&gt;http://engineering.ucsb.edu/~duonglt/vmware/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h1&gt;Getting started with Documentation:&lt;/h1&gt;
&lt;b&gt;Visit the vMA Home Page:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a class="jive-link-external" href="http://www.vmware.com/support/developer/vima/"&gt;VMware vMA&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;b&gt;vMA Forum:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a class="jive-link-community" href="http://communities.vmware.com/community/vmtn/vsphere/automationtools/vima" title="VMware vSphere™ Management Assistant (vMA): Linux Virtual Machine for deploying scripts and select 3rd-party agents"&gt;VMware vSphere&amp;trade; Management Assistant (vMA)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
You will find latest Downloads, Reference Documentation and Community Discussions and links to resources. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Downloads:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a class="jive-link-external" href="http://www.vmware.com/downloads/download.do?downloadGroup=VIMA"&gt;VIMA 1.0 Download&lt;/a&gt; - Supports ESX(i) 3.5u2+&lt;/li&gt;
&lt;li&gt;&lt;a class="jive-link-external" href="http://www.vmware.com/download/download.do?downloadGroup=VMA40"&gt;vMA 4.0 Download&lt;/a&gt; - Supports ESX(i) 3.5u2/4.0 and vCenter 2.5/4.0&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;hr /&gt;
&lt;h1&gt;Examples&lt;/h1&gt;
&lt;b&gt;Examples of vMA/VIMA usage:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a class="jive-link-external" href="http://engineering.ucsb.edu/~duonglt/vmware/#vmware_vima"&gt;http://engineering.ucsb.edu/~duonglt/vmware/#vmware_vima&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;h1&gt;Scripts and Tools&lt;/h1&gt;
&lt;b&gt;New tools and scripts to add/manage ESX(i) and vCenter targets on vMA 4.0:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a class="jive-link-external" href="http://engineering.ucsb.edu/~duonglt/vmware/#vmware_vma"&gt;http://engineering.ucsb.edu/~duonglt/vmware/#vmware_vma&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;b&gt;vMA Compatible Agent/Scripts(Third Party) Community List:&lt;/b&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a class="jive-link-wiki" href="http://communities.vmware.com/docs/DOC-10772"&gt;vMA Compatible Agent/Scripts(Third Party) Community List&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;b&gt;Health check reports on your VMware environment:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a class="jive-link-wiki" href="http://communities.vmware.com/docs/DOC-9842"&gt;VMware vSphere Health Check Report v1.3&lt;/a&gt; - vMA 4.0&lt;/li&gt;
&lt;li&gt;&lt;a class="jive-link-wiki" href="http://communities.vmware.com/docs/DOC-9420"&gt;VMware Health Check Report v0.9.4&lt;/a&gt; - VIMA 1.0&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;b&gt;Taking screenshots of your VM using vMA 4.0:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a class="jive-link-wiki" href="http://communities.vmware.com/docs/DOC-10497"&gt;takeVMScreenshot.pl using vMA 4.0&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;b&gt;Host and VM shutdown with UPS integration using vMA:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a class="jive-link-wiki" href="http://communities.vmware.com/docs/DOC-9531"&gt;ESX/ESXi APC/APCUPSD Host Shutdown VI Perl Toolkit Script (ghettoShutdown.pl/upsVIShutdown.pl)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;b&gt;Backup VMs using vMA:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a class="jive-link-wiki" href="http://communities.vmware.com/docs/DOC-9843"&gt;ghettoVCBg2 - Free alternative for backing up VMs in ESX(i) 3.5 and 4.x (no SSH console required!)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;b&gt;Utilize vi-fastpass On vMA to run Perl script without clear text password:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a class="jive-link-external" href="http://communities.vmware.com/docs/DOC-10883"&gt;useVIFastpassOnvMAToRunPerlScriptWithoutClearTextPassword.pl&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;hr /&gt;
&lt;h1&gt;Tweaks&lt;/h1&gt;
&lt;b&gt;Hot add memory to vMA or other supported Linux guestOSes using vSphere ESX(i) 4.0:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a class="jive-link-wiki" href="http://communities.vmware.com/docs/DOC-10492"&gt;Hot add memory to vMA or other supported Linux guestOSes using vSphere ESX(i) 4.0&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;b&gt;How to increase/resize vMA Disks:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a class="jive-link-wiki" href="http://communities.vmware.com/docs/DOC-10501"&gt;How to increase/resize vMA Disks&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;b&gt;Offline patching of vMA 4.0:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a class="jive-link-thread" href="http://communities.vmware.com/thread/233898"&gt;Update vMA without internet access&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;b&gt;How to install VMware VDDK on vMA:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a class="jive-link-thread" href="http://communities.vmware.com/thread/212352"&gt;How to install VDDK 1.1 on vMA 4.0 (libfuse.so.2 fix)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;b&gt;Enable root account:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Edit /etc/passwd &lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;sudo vi /etc/passwd
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Change&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;root:x:0:0:root:/root:/sbin/nologin
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;root:x:0:0:root:/root:/bin/bash
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
Help us improve our document, provide additional useful information and share with a friend.</description>
      <category domain="http://communities.vmware.com/tags?communityID=2687">vima</category>
      <category domain="http://communities.vmware.com/tags?communityID=2687">vima1.0</category>
      <category domain="http://communities.vmware.com/tags?communityID=2687">vma</category>
      <category domain="http://communities.vmware.com/tags?communityID=2687">vma4.0</category>
      <category domain="http://communities.vmware.com/tags?communityID=2687">vma4</category>
      <category domain="http://communities.vmware.com/tags?communityID=2687">vcli</category>
      <category domain="http://communities.vmware.com/tags?communityID=2687">rcli</category>
      <pubDate>Wed, 14 Oct 2009 18:06:35 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-10878</guid>
      <dc:date>2009-10-14T18:06:35Z</dc:date>
      <clearspace:dateToText>1 month, 1 week ago</clearspace:dateToText>
    </item>
    <item>
      <title>ESX Update Tools</title>
      <link>http://communities.vmware.com/docs/DOC-10815</link>
      <description />
      <category domain="http://communities.vmware.com/tags?communityID=3102">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=3102">update</category>
      <category domain="http://communities.vmware.com/tags?communityID=3102">esxupdate</category>
      <category domain="http://communities.vmware.com/tags?communityID=3102">vmware</category>
      <category domain="http://communities.vmware.com/tags?communityID=3102">vi</category>
      <category domain="http://communities.vmware.com/tags?communityID=3102">infrastructure</category>
      <category domain="http://communities.vmware.com/tags?communityID=3102">automation</category>
      <category domain="http://communities.vmware.com/tags?communityID=3102">patch</category>
      <pubDate>Thu, 24 Sep 2009 14:42:55 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-10815</guid>
      <dc:date>2009-09-24T14:42:55Z</dc:date>
      <clearspace:dateToText>2 months, 2 days ago</clearspace:dateToText>
    </item>
    <item>
      <title>ESX Install Kit</title>
      <link>http://communities.vmware.com/docs/DOC-10814</link>
      <description />
      <category domain="http://communities.vmware.com/tags?communityID=2530">automation</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">vm</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">vmware</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">vitoolkit</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">powercli</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">script</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">toolkit</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">vi_toolkit_windows</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">esx</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">esxi</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">deployment</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">factory</category>
      <pubDate>Thu, 24 Sep 2009 13:42:26 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-10814</guid>
      <dc:date>2009-09-24T13:42:26Z</dc:date>
      <clearspace:dateToText>1 week, 3 days ago</clearspace:dateToText>
      <clearspace:replyCount>1</clearspace:replyCount>
    </item>
    <item>
      <title>New version of vifs.pl</title>
      <link>http://communities.vmware.com/docs/DOC-10774</link>
      <description />
      <category domain="http://communities.vmware.com/tags?communityID=3087">cli</category>
      <category domain="http://communities.vmware.com/tags?communityID=3087">perl</category>
      <category domain="http://communities.vmware.com/tags?communityID=3087">datacenter</category>
      <pubDate>Tue, 22 Sep 2009 10:38:19 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-10774</guid>
      <dc:date>2009-09-22T10:38:19Z</dc:date>
      <clearspace:dateToText>1 month, 1 week ago</clearspace:dateToText>
    </item>
    <item>
      <title>vMA Compatible Agent/Scripts(Third Party) Community List</title>
      <link>http://communities.vmware.com/docs/DOC-10772</link>
      <description>Folks,&lt;br /&gt;
&lt;br /&gt;
The intention of this document is to list third party agents / scripts that work with vSphere Management Assistant. &lt;br /&gt;
&lt;br /&gt;
If you are a third party software vendor, or anyone with an interesting script that you have tested on vSphere Management Assitant, please add to the list below. The benefit is that the community will be able to determine and quickly see if your agent runs on vMA. This is very much a community effort and look for your help in maintaining this list. &lt;br /&gt;
&lt;br /&gt;
&lt;table class="jive-wiki-table"&gt;
&lt;tr&gt;
&lt;td&gt;Product Name&lt;/td&gt;
&lt;td&gt;Owner&lt;/td&gt;
&lt;td&gt;Link&lt;/td&gt;
&lt;td&gt;vMA Compatible Version&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VMware Health Check Report v0.9.4 &lt;/td&gt;
&lt;td&gt;William Lam &lt;/td&gt;
&lt;td&gt;&lt;a class="jive-link-wiki" href="http://communities.vmware.com/docs/DOC-9420"&gt;VMware Health Check Report v0.9.4&lt;/a&gt; &lt;/td&gt;
&lt;td&gt;VIMA 1.0 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VMware vSphere Health Check Report v1.2 &lt;/td&gt;
&lt;td&gt;William Lam &lt;/td&gt;
&lt;td&gt;&lt;a class="jive-link-wiki" href="http://communities.vmware.com/docs/DOC-9842"&gt;VMware vSphere Health Check Report v1.3&lt;/a&gt; &lt;/td&gt;
&lt;td&gt;vMA 4.0 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ghettoShutdown.pl/upsVIShutdown.pl &lt;/td&gt;
&lt;td&gt;William Lam &lt;/td&gt;
&lt;td&gt;&lt;a class="jive-link-wiki" href="http://communities.vmware.com/docs/DOC-9531"&gt;ESX/ESXi APC/APCUPSD Host Shutdown VI Perl Toolkit Script (ghettoShutdown.pl/upsVIShutdown.pl)&lt;/a&gt; &lt;/td&gt;
&lt;td&gt;VIMA 1.0 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ghettoVCBg2 &lt;/td&gt;
&lt;td&gt;William Lam &lt;/td&gt;
&lt;td&gt;&lt;a class="jive-link-wiki" href="http://communities.vmware.com/docs/DOC-9843"&gt;ghettoVCBg2 - Free alternative for backing up VMs in ESX(i) 3.5 and 4.x (no SSH console required!)&lt;/a&gt; &lt;/td&gt;
&lt;td&gt;vMA 4.0 &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;br clear="left" /&gt;</description>
      <category domain="http://communities.vmware.com/tags?communityID=2687">third_party_agents_scripts</category>
      <category domain="http://communities.vmware.com/tags?communityID=2687">vma</category>
      <category domain="http://communities.vmware.com/tags?communityID=2687">register_your_agent_script</category>
      <pubDate>Tue, 15 Sep 2009 23:57:33 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-10772</guid>
      <dc:date>2009-09-15T23:57:33Z</dc:date>
      <clearspace:dateToText>2 months, 1 week ago</clearspace:dateToText>
    </item>
    <item>
      <title>Instructions on how to install vCLI 32bit/64bit on Ubuntu 9.04</title>
      <link>http://communities.vmware.com/docs/DOC-10698</link>
      <description>Apparently &lt;a class="jive-link-external" href="http://www.vmware.com/support/developer/vcli/"&gt;VMware vCLI&lt;/a&gt; does not support Ubuntu 9.04 out of the box per &lt;a class="jive-link-message" href="http://communities.vmware.com/message/1358374#1358374"&gt;Re: Installing vCLI on Ubuntu Server 9.04&lt;/a&gt;, but thanks to &lt;a class="jive-link-profile" href="http://communities.vmware.com/people/eparthuisot"&gt;eparthuisot&lt;/a&gt;, it's actually only two packages that you need to install to get the latest version of vCLI installed on your minimal Ubunutu server. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Setup:&lt;/b&gt; &lt;br /&gt;
Ubuntu server 9.04 (32bit or 64bit)&lt;br /&gt;
&lt;a class="jive-link-external" href="http://www.vmware.com/support/developer/vcli/"&gt;VMware-vSphere-CLI-4.0.0-161974.i386.tar&lt;/a&gt; (32bit installer)&lt;br /&gt;
&lt;a class="jive-link-external" href="http://www.vmware.com/support/developer/vcli/"&gt;VMware-vSphere-CLI-4.0.0-161974.x86_64.tar&lt;/a&gt; (64bit installer)&lt;br /&gt;
libxml-libxml-perl &lt;br /&gt;
libclass-methodmaker-perl&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Instructions:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
0. Verify version of Ubuntu:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;primp@ubuntu-test:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 9.04
Release:        9.04
Codename:       jaunty
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
&lt;h2&gt;Steps for installing on Ubuntu Server 9.04 32bit:&lt;/h2&gt;
&lt;br /&gt;
1. Download vCLI from VMware's site and upload via scp or other means to your Ubuntu system&lt;br /&gt;
&lt;br /&gt;
2. Download and install &lt;b&gt;libxml-libxml-perl&lt;/b&gt; and &lt;b&gt;libclass-methodmaker-perl&lt;/b&gt; and &lt;b&gt;libcrypt-ssleay-perl&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;primp@ubuntu-test:~$ sudo apt-get install libxml-libxml-perl
[sudo] password for primp:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  libxml-libxml-common-perl libxml-namespacesupport-perl libxml-sax-expat-perl libxml-sax-perl
The following NEW packages will be installed:
  libxml-libxml-common-perl libxml-libxml-perl libxml-namespacesupport-perl libxml-sax-expat-perl libxml-sax-perl
0 upgraded, 5 newly installed, 0 to remove and 51 not upgraded.
Need to get 523kB of archives.
After this operation, 2064kB of additional disk space will be used.
Do you want to continue [Y/n]? y
.......
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;primp@ubuntu-test:~$ sudo apt-get install libclass-methodmaker-perl
.......
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;primp@ubuntu-test:~$ sudo apt-install libcrypt-ssleay-perl 
.......
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
&lt;b&gt;Note:&lt;/b&gt; If you're doing this as a regular user, you may need to use sudo or switch over to root to perform these elevated operations&lt;br /&gt;
&lt;br /&gt;
3. Extract vCLI tar file&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;primp@ubuntu-test:~$ tar -zxvf VMware-vSphere-CLI-4.0.0-161974.i386.tar.gz
.......
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
4. Install vCLI&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;primp@ubuntu-test:~$ cd vmware-vsphere-cli-distrib/

primp@ubuntu-test:~/vmware-vsphere-cli-distrib$ sudo ./vmware-install.pl
Creating a new vSphere CLI installer database using the tar4 format.

Installing vSphere CLI.

Installing version 161974 of vSphere CLI


You must read and accept the vSphere CLI End User License Agreement to
continue.
Press enter to display it.

......
&amp;lt;stick with the defaults&amp;gt;
......

Please wait while copying vSphere CLI files...

The installation of vSphere CLI 4.0.0 build-161974 for Linux completed
successfully. You can decide to remove this software from your system at any
time by invoking the following command:
&amp;quot;/usr/bin/vmware-uninstall-vSphere-CLI.pl&amp;quot;.

This installer has successfully installed both vSphere CLI and the vSphere SDK
for Perl.

Enjoy,

&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
5. Verify vCLI&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;primp@ubuntu-test-32bit:~$ esxcfg-nas -l --server himalaya.primp-industries.com --username root
Enter password:

dlgCore-NFS-bigboi.VM-Backups is /exports/XXXXXX from A.B.C.D mounted
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
&lt;h2&gt;Steps for installing on Ubuntu Server 9.04 64bit:&lt;/h2&gt;
&lt;br /&gt;
1. Download vCLI from VMware's site and upload via scp or other means to your Ubuntu system&lt;br /&gt;
&lt;br /&gt;
2. Download and install &lt;b&gt;libxml-libxml-perl&lt;/b&gt; and &lt;b&gt;libclass-methodmaker-perl&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;primp@ubuntu-test:~$ sudo apt-get install libxml-libxml-perl
[sudo] password for primp:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  libxml-libxml-common-perl libxml-namespacesupport-perl libxml-sax-expat-perl libxml-sax-perl
The following NEW packages will be installed:
  libxml-libxml-common-perl libxml-libxml-perl libxml-namespacesupport-perl libxml-sax-expat-perl libxml-sax-perl
0 upgraded, 5 newly installed, 0 to remove and 51 not upgraded.
Need to get 523kB of archives.
After this operation, 2064kB of additional disk space will be used.
Do you want to continue [Y/n]? y
.......
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;primp@ubuntu-test:~$ sudo apt-get install libclass-methodmaker-perl
.......
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
&lt;b&gt;Note:&lt;/b&gt; If you're doing this as a regular user, you may need to use sudo or switch over to root to perform these elevated operations&lt;br /&gt;
&lt;br /&gt;
3. Extract vCLI tar file&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;primp@ubuntu-test:~$ tar -zxvf VMware-vSphere-CLI-4.0.0-161974.x86_64.tar
.......
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
4. Install vCLI&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;primp@ubuntu-test:~$ cd vmware-vsphere-cli-distrib/

primp@ubuntu-test:~/vmware-vsphere-cli-distrib$ sudo ./vmware-install.pl
Creating a new vSphere CLI installer database using the tar4 format.

Installing vSphere CLI.

Installing version 161974 of vSphere CLI


You must read and accept the vSphere CLI End User License Agreement to
continue.
Press enter to display it.

......
&amp;lt;stick with the defaults&amp;gt;
......

Please wait while copying vSphere CLI files...

The installation of vSphere CLI 4.0.0 build-161974 for Linux completed
successfully. You can decide to remove this software from your system at any
time by invoking the following command:
&amp;quot;/usr/bin/vmware-uninstall-vSphere-CLI.pl&amp;quot;.

This installer has successfully installed both vSphere CLI and the vSphere SDK
for Perl.

Enjoy,

&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
5. Verify vCLI&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;primp@ubuntu-test-64bit:~$ esxcfg-nas -l --server himalaya.primp-industries.com --username root
Enter password:

dlgCore-NFS-bigboi.VM-Backups is /exports/XXXXXX from A.B.C.D mounted
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
and now you're on your way to using vCLI on Ubuntu!</description>
      <category domain="http://communities.vmware.com/tags?communityID=3087">ubuntu</category>
      <category domain="http://communities.vmware.com/tags?communityID=3087">9.04</category>
      <category domain="http://communities.vmware.com/tags?communityID=3087">vcli</category>
      <category domain="http://communities.vmware.com/tags?communityID=3087">vsphere</category>
      <pubDate>Thu, 10 Sep 2009 02:17:59 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-10698</guid>
      <dc:date>2009-09-10T02:17:59Z</dc:date>
      <clearspace:dateToText>2 months, 6 days ago</clearspace:dateToText>
      <clearspace:replyCount>4</clearspace:replyCount>
    </item>
    <item>
      <title>Using VI Toolkit from .Net C#</title>
      <link>http://communities.vmware.com/docs/DOC-10631</link>
      <description>&lt;a class="jive-link-external" href="http://www.slideshare.net/vmwarecarter/using-vi-toolkit-for-windows-from-net#"&gt;http://www.slideshare.net/vmwarecarter/using-vi-toolkit-for-windows-from-net#&lt;/a&gt;</description>
      <category domain="http://communities.vmware.com/tags?communityID=2530">vi</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">toolkit</category>
      <pubDate>Fri, 28 Aug 2009 05:44:54 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-10631</guid>
      <dc:date>2009-08-28T05:44:54Z</dc:date>
      <clearspace:dateToText>2 months, 4 weeks ago</clearspace:dateToText>
    </item>
    <item>
      <title>Check for Privileges</title>
      <link>http://communities.vmware.com/docs/DOC-10607</link>
      <description />
      <category domain="http://communities.vmware.com/tags?communityID=2530">powercli</category>
      <pubDate>Wed, 26 Aug 2009 03:14:42 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-10607</guid>
      <dc:date>2009-08-26T03:14:42Z</dc:date>
      <clearspace:dateToText>3 months, 1 day ago</clearspace:dateToText>
    </item>
    <item>
      <title>takeVMScreenshot.pl using vMA 4.0</title>
      <link>http://communities.vmware.com/docs/DOC-10497</link>
      <description>Ever run into issues with your VMs where you have some debugging information logged to the console and you want to take a screenshot of it using vSphere API?&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Requirement&lt;/b&gt;&lt;br /&gt;
ESX(i) 4.0 (must execute against individual ESX(i) host and not vCenter)&lt;br /&gt;
vMA 4.0&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Sample Execution:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;[vi-admin@scofield ~]$ ./takeVMScreenshot.pl --server himalaya.primp-industries.com --username root --vmname William-XP
Enter password:

Initiating screenshot of William-XP ...
Successfully capture screenshot from William-XP!
Downloading &amp;quot;William-XP-screenshot-0.png&amp;quot; to &amp;quot;vm_screenshots/William-XP-screenshot-0.png&amp;quot;
Removing screenshot &amp;quot;William-XP-screenshot-0.png&amp;quot; from ESX(i) host ...

&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
Here is what &lt;b&gt;William-XP-screenshot-0.png&lt;/b&gt; looks like:&lt;br /&gt;
&lt;br /&gt;
&lt;img src="http://communities.vmware.com/servlet/JiveServlet/downloadImage/102-10497-2-6554/William-XP-screenshot-0.png" alt="William-XP-screenshot-0.png" width="620" class="jive-image-thumbnail jive-image" onclick="myJiveImage.start(this, 'http://communities.vmware.com/servlet/JiveServlet/downloadImage/102-10497-2-6554/William-XP-screenshot-0.png');return false;"/&gt;</description>
      <category domain="http://communities.vmware.com/tags?communityID=2687">vma4.0</category>
      <category domain="http://communities.vmware.com/tags?communityID=2687">screenshot</category>
      <pubDate>Wed, 12 Aug 2009 05:30:33 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-10497</guid>
      <dc:date>2009-08-12T05:30:33Z</dc:date>
      <clearspace:dateToText>3 months, 2 weeks ago</clearspace:dateToText>
      <clearspace:replyCount>4</clearspace:replyCount>
    </item>
    <item>
      <title>Hot add memory to vMA or other supported Linux guestOSes using vSphere ESX(i) 4.0</title>
      <link>http://communities.vmware.com/docs/DOC-10492</link>
      <description>&lt;h2&gt;Summary&lt;/h2&gt;
This document will demonstrate how to hot add memory to a live running vMA (RHEL5) VM using vSphere ESX(i) 4.0, this feature is only supported on certain guestOSes, check vSphere documentation for more information. &lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Resources&lt;/h2&gt;
&lt;a class="jive-link-external" href="http://adaptivethinking.wordpress.com/2009/07/27/vsphere-esx4-hot-add-memory-for-linux-guests/"&gt;http://adaptivethinking.wordpress.com/2009/07/27/vsphere-esx4-hot-add-memory-for-linux-guests/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Requirements&lt;/h2&gt;
ESX(i) 4.0&lt;br /&gt;
vMA 4.0 or other supported Linux guestOSes&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Instructions&lt;/h2&gt;
&lt;b&gt;1&lt;/b&gt;. Hot add memory requires a VM to be running hardware version 7 and since vMA 4.0 by default is distributed as HW4, you'll need to first right click on the VM and upgrade to hardware 7 before powering on the VM. You will also need to enable hot add memory which is a new configuration item once you've upgraded to HW7 under OPTIONS-&amp;gt;Memory/CPU Hotplug and just select 'enable'&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;2&lt;/b&gt;. Power on vMA&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;3&lt;/b&gt;. Let's verify the default memory available within vMA (this can be done using free,/proc/meminfo,top,etc)&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;[vi-admin@vMa-resize ~]$ free -m
             total       used       free     shared    buffers     cached
Mem:           498        178        320          0          6         98
-/+ buffers/cache:         73        425
Swap:         1023          0       1023

[vi-admin@vMa-resize ~]$ cat /proc/meminfo m
MemTotal:       510668 kB
MemFree:        327696 kB
Buffers:          6740 kB
Cached:         101200 kB
SwapCached:          0 kB
Active:         110392 kB
Inactive:        43864 kB
HighTotal:           0 kB
HighFree:            0 kB
LowTotal:       510668 kB
LowFree:        327696 kB
SwapTotal:     1048568 kB
SwapFree:      1048568 kB
Dirty:              24 kB
Writeback:           0 kB
AnonPages:       46340 kB
Mapped:          43704 kB
Slab:            12584 kB
PageTables:       2408 kB
NFS_Unstable:        0 kB
Bounce:              0 kB
CommitLimit:   1303900 kB
Committed_AS:   222648 kB
VmallocTotal: 34359738367 kB
VmallocUsed:    263328 kB
VmallocChunk: 34359474423 kB
HugePages_Total:     0
HugePages_Free:      0
HugePages_Rsvd:      0
Hugepagesize:     2048 kB

&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
Default installation of vMA 4.0 is 512mb of memory, we'll increase this to 1gb&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;4&lt;/b&gt;. You will now use the vSphere Client and edit the vMA's memory and change it from 512mb to 1gb&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;5&lt;/b&gt;. Download and copy &lt;b&gt;online_hotplug_memory.sh&lt;/b&gt; to vMA&lt;br /&gt;
&lt;p /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;[root@vMa-resize ~]# chmod +x online_hotplug_memory.sh
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
&lt;b&gt;6&lt;/b&gt;. Execute the script which will find any new memory allocated to vMA and online the memory&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;[root@vMa-resize ~]# sudo ./online_hotplug_memory.sh
Found sparsemem: &amp;quot;/sys/devices/system/memory/memory0&amp;quot; ...
        memory0 already online
Found sparsemem: &amp;quot;/sys/devices/system/memory/memory1&amp;quot; ...
        memory1 already online
Found sparsemem: &amp;quot;/sys/devices/system/memory/memory2&amp;quot; ...
        memory2 already online
Found sparsemem: &amp;quot;/sys/devices/system/memory/memory3&amp;quot; ...
        memory3 already online
Found sparsemem: &amp;quot;/sys/devices/system/memory/memory4&amp;quot; ...
        memory4 is new memory, onlining memory ...
Found sparsemem: &amp;quot;/sys/devices/system/memory/memory5&amp;quot; ...
        memory5 is new memory, onlining memory ...
Found sparsemem: &amp;quot;/sys/devices/system/memory/memory7&amp;quot; ...
        memory7 is new memory, onlining memory ...

&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
As you can see from the script output memory&lt;a class="jive-link-adddocument" href="http://communities.vmware.com/community-document-picker.jspa?communityID=2687&amp;subject=0-3"&gt;0-3&lt;/a&gt; was already allocated and split up but memory&lt;a class="jive-link-adddocument" href="http://communities.vmware.com/community-document-picker.jspa?communityID=2687&amp;subject=4-7"&gt;4-7&lt;/a&gt; was the newly added memory which needed to be brought online before the OS can use it.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;7&lt;/b&gt;. Let's verify the new memory that has been allocated while the VM was running&lt;br /&gt;
&lt;p /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;[root@vMa-resize ~]# free -m
             total       used       free     shared    buffers     cached
Mem:           882        188        694          0          7        100
-/+ buffers/cache:         80        802
Swap:         1023          0       1023

[root@vMa-resize ~]# cat /proc/meminfo
MemTotal:       903884 kB
MemFree:        711128 kB
Buffers:          7644 kB
Cached:         102612 kB
SwapCached:          0 kB
Active:         111996 kB
Inactive:        45060 kB
HighTotal:           0 kB
HighFree:            0 kB
LowTotal:       903884 kB
LowFree:        711128 kB
SwapTotal:     1048568 kB
SwapFree:      1048568 kB
Dirty:              36 kB
Writeback:           0 kB
AnonPages:       46836 kB
Mapped:          43708 kB
Slab:            12748 kB
PageTables:       2460 kB
NFS_Unstable:        0 kB
Bounce:              0 kB
CommitLimit:   1500508 kB
Committed_AS:   224736 kB
VmallocTotal: 34359738367 kB
VmallocUsed:    263628 kB
VmallocChunk: 34359474423 kB
HugePages_Total:     0
HugePages_Free:      0
HugePages_Rsvd:      0
Hugepagesize:     2048 kB

&lt;/code&gt;&lt;/pre&gt;</description>
      <category domain="http://communities.vmware.com/tags?communityID=2687">vma4.0</category>
      <category domain="http://communities.vmware.com/tags?communityID=2687">vma</category>
      <category domain="http://communities.vmware.com/tags?communityID=2687">hot_add_memory</category>
      <category domain="http://communities.vmware.com/tags?communityID=2687">hot_add</category>
      <pubDate>Sun, 09 Aug 2009 18:47:36 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-10492</guid>
      <dc:date>2009-08-09T18:47:36Z</dc:date>
      <clearspace:dateToText>3 months, 2 weeks ago</clearspace:dateToText>
    </item>
    <item>
      <title>How to increase/resize vMA Disks</title>
      <link>http://communities.vmware.com/docs/DOC-10501</link>
      <description>&lt;h2&gt;Summary: &lt;/h2&gt;
If you're extensively using vMA's vi-logger functionality or storing lots of content on the default 5gb VMDK, you can easily fill up the disks.  This document will provide the steps in resizing and increasing the disk sizes using LVM.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Environment:&lt;/h2&gt;
vMA 4.0 or VIMA 1.0 (not testing on VIMA 1.0, but steps should be exactly the same)&lt;br /&gt;
SSH and/or vSphere Client console access&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Operation:&lt;/h2&gt;
Increase &lt;u&gt;/var/log&lt;/u&gt; from 500MB to 10GB&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Steps:&lt;/h2&gt;
1. Here is a default vanilla installation of &lt;a class="jive-link-external" href="http://www.vmware.com/support/developer/vima/index.html"&gt;vMA&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;Last login: Sat Aug  8 15:00:31 2009 from 172.30.0.225

Welcome to vMA
run 'vma-help' or see http://www.vmware.com/go/vma4 for more details.

[vi-admin@vMa-resize ~]$ cat /etc/vima-release | head -1
vMA 4.0.0 BUILD-161992

[vi-admin@vMa-resize ~]$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-root
                      3.3G  1.5G  1.7G  48% /
/dev/mapper/VolGroup00-var
                      496M   19M  452M   4% /var/log
/dev/sda1              99M   16M   79M  17% /boot
tmpfs                 250M     0  250M   0% /dev/shm

&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
2. Notice &lt;b&gt;/var/log&lt;/b&gt; has total of 452MB free and I will attempt to fill it up to 98%&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;[vi-admin@vMa-resize ~]$ sudo dd if=/dev/zero of=/var/log/big_ass_file bs=1M count=440
440+0 records in
440+0 records out
461373440 bytes (461 MB) copied, 9.64461 seconds, 47.8 MB/s

[vi-admin@vMa-resize ~]$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-root
                      3.3G  1.5G  1.7G  48% /
/dev/mapper/VolGroup00-var
                      496M  461M  9.9M  98% /var/log
/dev/sda1              99M   16M   79M  17% /boot
tmpfs                 250M     0  250M   0% /dev/shm

&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
&lt;b&gt;OH NO!&lt;/b&gt;  &lt;img class="jive-emoticon" border="0" src="http://communities.vmware.com/images/emoticons/sad.gif" alt=":(" /&gt;  &lt;u&gt;/var/log&lt;/u&gt; is full, what to do! Let's increase the size of /var/log to 10GB, that should be plenty for logs.&lt;br /&gt;
&lt;br /&gt;
3. Shutdown the vMA and edit the VM configurations and change the disk from 5gb to 15GB (increase of 10GB)&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;[vi-admin@vMa-resize ~]$ sudo shutdown -h now
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
4. Power back on vMA&lt;br /&gt;
&lt;br /&gt;
5. As you can see we've grown the virtual disk from 5gb to 16gb&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;[vi-admin@vMa-resize ~]$ sudo fdisk -l
Password:

Disk /dev/sda: 16.1 GB, 16106127360 bytes
255 heads, 63 sectors/track, 1958 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14         652     5132767+  8e  Linux LVM

&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
6. Next we'll be creating a new partition with the new space&lt;br /&gt;
&lt;p /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;[vi-admin@vMa-resize ~]$ sudo fdisk /dev/sda

The number of cylinders for this disk is set to 1958.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (653-1958, default 653):
Using default value 653
Last cylinder or +size or +sizeM or +sizeK (653-1958, default 1958):
Using default value 1958

Command (m for help): t
Partition number (1-4): 3
Hex code (type L to list codes): 8e
Changed system type of partition 3 to 8e (Linux LVM)

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.

&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
&lt;b&gt;Note:&lt;/b&gt; The options were: n,p,3,&amp;lt;enter&amp;gt;,t,3,8e,w&lt;br /&gt;
&lt;br /&gt;
7. We now verify the new partition has been created:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;[vi-admin@vMa-resize ~]$ sudo fdisk -l

Disk /dev/sda: 16.1 GB, 16106127360 bytes
255 heads, 63 sectors/track, 1958 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14         652     5132767+  8e  Linux LVM
/dev/sda3             653        1958    10490445   8e  Linux LVM
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
&lt;b&gt;/dev/sda3&lt;/b&gt; is our new partition which has been formatted with LVM, we now need to reboot vMA before continuing. &lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;vi-admin@vMa-resize ~]$ sudo reboot
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
8. We need to add a physical volume before LVM can access the partition&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;[vi-admin@vMa-resize ~]$ sudo pvcreate /dev/sda3
  Physical volume &amp;quot;/dev/sda3&amp;quot; successfully created
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
9. Now we need to extend the existing volume group to the physical volume which was found by doing (df -h)&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;[vi-admin@vMa-resize ~]$ sudo vgextend VolGroup00 /dev/sda3
  /dev/hda: open failed: No medium found
  Volume group &amp;quot;VolGroup00&amp;quot; successfully extended
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
10. Now we'll want to extend the logical volume into the new space, but we want to make sure how much the system will give us in terms of free space&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;[vi-admin@vMa-resize ~]$ sudo vgdisplay | grep -i free
  Free  PE / Size       320 / 10.00 GB

&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
As you can see, that is the additional 10GB we've added on top of the already existing 5GB&lt;br /&gt;
&lt;br /&gt;
11. Now we extend the LV to &lt;b&gt;/var&lt;/b&gt; and not to another mount point and we'll increase that to 10GB&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;[vi-admin@vMa-resize ~]$ sudo lvextend -L+10G /dev/VolGroup00/var
  Extending logical volume var to 10.50 GB
  Logical volume var successfully resized
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
12. Last step is to make this space available to the OS, on general RHEL systems you have access to &lt;b&gt;ext2online&lt;/b&gt; but since vMA is a stripped down version of RHEL, that is not available. We'll make uses of &lt;b&gt;resize2fs&lt;/b&gt; to accomplish the same task&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;[vi-admin@vMa-resize ~]$ sudo resize2fs -p /dev/VolGroup00/var
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/VolGroup00/var is mounted on /var/log; on-line resizing required
Performing an on-line resize of /dev/VolGroup00/var to 11010048 (1k) blocks.
The filesystem on /dev/VolGroup00/var is now 11010048 blocks long.

&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
&lt;b&gt;Note:&lt;/b&gt; This task can take a few minutes depending on the disk size increase&lt;br /&gt;
&lt;br /&gt;
13. Now we verify the new disk increase for &lt;b&gt;/var/log&lt;/b&gt; for 10GB&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;[vi-admin@vMa-resize ~]$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-root
                      3.3G  1.5G  1.7G  48% /
/dev/mapper/VolGroup00-var
                       11G  462M  9.2G   5% /var/log
/dev/sda1              99M   16M   79M  17% /boot
tmpfs                 250M     0  250M   0% /dev/shm
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
voil&amp;agrave;! you've just increased the disk space on the default installation of vMA.</description>
      <category domain="http://communities.vmware.com/tags?communityID=2687">vma</category>
      <category domain="http://communities.vmware.com/tags?communityID=2687">vima</category>
      <category domain="http://communities.vmware.com/tags?communityID=2687">vma4</category>
      <category domain="http://communities.vmware.com/tags?communityID=2687">lvm</category>
      <category domain="http://communities.vmware.com/tags?communityID=2687">resize</category>
      <pubDate>Sat, 08 Aug 2009 22:46:54 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-10501</guid>
      <dc:date>2009-08-08T22:46:54Z</dc:date>
      <clearspace:dateToText>3 months, 2 weeks ago</clearspace:dateToText>
    </item>
    <item>
      <title>Quick Migrate Function</title>
      <link>http://communities.vmware.com/docs/DOC-10441</link>
      <description>&lt;h2&gt;VMWare Quick Migration Function&lt;/h2&gt;
&lt;br /&gt;
&lt;b&gt;Author&lt;/b&gt;: Justin Grote &amp;lt;jgrote NOSPAMAT enpointe DOT com&amp;gt;&lt;br /&gt;
&lt;b&gt;Credit&lt;/b&gt;: Inspired by Mike DiPetrillo's Quick Migration Script: &lt;a class="jive-link-external" href="http://www.mikedipetrillo.com/mikedvirtualization/2008/10/quick-migration-for-vmware-the-power-of-powershell.html"&gt;http://www.mikedipetrillo.com/mikedvirtualization/2008/10/quick-migration-for-vmware-the-power-of-powershell.html&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;Version&lt;/b&gt;: 0.1&lt;br /&gt;
&lt;b&gt;Last Revised&lt;/b&gt;: 31 July 2009&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Description&lt;/b&gt;: Performs the fucntional equivalent of a Hyper-V Quick Migration by suspending a VM, &lt;br /&gt;
 moving it to a new host, and resuming it. This does not require vMotion licensing.&lt;br /&gt;
 it works by providing required VM objects via the pipeline or the second argument, &lt;br /&gt;
 and specifying the Destination host in the first argument.&lt;br /&gt;
 The commeand accepts both text strings and VMHost objects for the VMHost Parameter&lt;br /&gt;
&lt;p /&gt;
&lt;b&gt;Prerequisites&lt;/b&gt;:&lt;br /&gt;
Powershell v1&lt;br /&gt;
VMWare PowerCLI 4.0 (May work with earlier version but not tested)&lt;br /&gt;
&lt;br /&gt;
Instructions to Install: Save this script and import into your session with, for example, . C:\temp\quickmigrate.ps1&lt;br /&gt;
You can also include it in your PowerCLI profile to have it automatically included.&lt;br /&gt;
&lt;p /&gt;
&lt;b&gt;Command Usage&lt;/b&gt;: get-vm MyTestVM | Quick-MigrateVM "MyTestHost2"</description>
      <pubDate>Fri, 31 Jul 2009 19:43:20 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-10441</guid>
      <dc:date>2009-07-31T19:43:20Z</dc:date>
      <clearspace:dateToText>3 months, 3 weeks ago</clearspace:dateToText>
    </item>
    <item>
      <title>Changes to the ESX Service Console for ESX 4.0</title>
      <link>http://communities.vmware.com/docs/DOC-10411</link>
      <description />
      <category domain="http://communities.vmware.com/tags?communityID=3087">esx</category>
      <category domain="http://communities.vmware.com/tags?communityID=3087">cos</category>
      <category domain="http://communities.vmware.com/tags?communityID=3087">vsphere</category>
      <category domain="http://communities.vmware.com/tags?communityID=3087">what_is_new</category>
      <pubDate>Thu, 23 Jul 2009 23:25:20 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-10411</guid>
      <dc:date>2009-07-23T23:25:20Z</dc:date>
      <clearspace:dateToText>4 months, 4 days ago</clearspace:dateToText>
    </item>
    <item>
      <title>Get-Stat2 : another way of getting at the statistical data</title>
      <link>http://communities.vmware.com/docs/DOC-10384</link>
      <description>With the release of PowerCLI v4 the &lt;b&gt;Get-Stat&lt;/b&gt; cmdlet has been much improved.&lt;br /&gt;
&lt;br /&gt;
In October 2008, as a temporary solution for the problems with the Get-Stat cmdlet in older PowerCLI or VITK releases, I wrote the Get-Stat2 script.&lt;br /&gt;
The Get-Stat2 script allows lightly different parameters than the regular Get-Stat cmdlet.&lt;br /&gt;
&lt;br /&gt;
For that reason I will make the Get-Stat2 script available again (the original document was removed some time ago).&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;But please only use this script when you couldn't get the result you needed with the current Get-Stat cmdlet!&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;An extract from the original document:&lt;/i&gt;&lt;br /&gt;
The script accepts the following parameters:&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;-Entity &amp;lt;VIObject&amp;gt;	: the object for which the statiscal data will be collected. Only 1 object allowed !
-Start &amp;lt;DateTime&amp;gt;	: start of the interval
-Finish &amp;lt;DateTime&amp;gt;	: end of the interval
-Stat &amp;lt;string[]&amp;gt;	: array of statistic identifiers
-Instance &amp;lt;string&amp;gt;	: some statistic identifiers allow instances.
                        (&amp;quot;&amp;quot; : aggregate (default) / &amp;quot;*&amp;quot; : all instances / array of specific instances)
-Interval &amp;lt;string&amp;gt;	: desired sampling interval, allowed values: &amp;quot;RT&amp;quot;,&amp;quot;HI1&amp;quot;,&amp;quot;HI2&amp;quot;,&amp;quot;HI3&amp;quot;,&amp;quot;HI4&amp;quot;
			  RT : real time
                          HI : historical interval
                         (results in these defaults 20, 300, 1800, 7200, 86400 seconds)
-Maxsamples &amp;lt;int32&amp;gt;	: only for &amp;quot;Real time&amp;quot; interval; number of intervals
-QueryMetrics		: return all available metrics for the Entity
-QueryInstances	: return all available instances for the Entity and Stat
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;Update 01/11/08&lt;/u&gt;&lt;br /&gt;
When you add a new resource to an entity, the statistical data for historical intervals will not be available immediately.&lt;br /&gt;
You will have to wait at least till the sampling period of the historical interval has expired.&lt;br /&gt;
The QueryPerf method will return sampling periods (date/time stamps) but there will be no statistical data (yet).&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;you add a vCPU to a virtual machine&lt;/li&gt;
&lt;li&gt;data for HI2 for that CPU instance will only be available after +/- 30 minutes&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
The minimum wait time to see data for a new resource:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;RT     20 secs&lt;/li&gt;
&lt;li&gt;HI1    5 mins&lt;/li&gt;
&lt;li&gt;HI2    30 mins&lt;/li&gt;
&lt;li&gt;HI3    2 hours&lt;/li&gt;
&lt;li&gt;HI4    1 day&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
To avoid errors from the Get-Stat2 function a test was added to verify if any data was returned by the QueryPerf method.&lt;br /&gt;
If there is no data, the Get-Stat2 function returns $null.&lt;br /&gt;
&lt;br /&gt;
The attached script has been updated.&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;Update 15/02/09&lt;/u&gt;&lt;br /&gt;
The attached Get-Stat2.ps1 script has been updated.&lt;br /&gt;
The changes:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;corrected MaxSamples parameter&lt;/li&gt;
&lt;li&gt;corrected Cluster entity clastype&lt;/li&gt;
&lt;li&gt;corrected missing Start and Finish parameters test&lt;/li&gt;
&lt;li&gt;added -QueryMetrics option&lt;/li&gt;
&lt;li&gt;added -QueryInstances option&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
With the addition of these last two parameters, the script can now be used to&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;query all the &lt;b&gt;valid metrics&lt;/b&gt; for a specific entity&lt;/li&gt;
&lt;li&gt;query all the &lt;b&gt;valid instances&lt;/b&gt; for one or more metrics&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;u&gt;Example -QueryMetrics&lt;/u&gt;&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;
$esx = Get-VMHost &amp;lt;ESX-hostname&amp;gt; | Get-View
./Get-Stat2.ps1 -entity $esx -querymetrics |ft

&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
produces an array of custom objects like this&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;
Group                Name                               Rollup                  Id               Level                Type Unit
-----                ----                               ------                  --               -----                ---- ----
clusterServices      cpufairness                        latest                 105                   1            absolute number
clusterServices      memfairness                        latest                 106                   1            absolute number
cpu                  idle                            summation                 112                   3               delta millisecond
cpu                  reservedCapacity                  average                 110                   2            absolute megaHertz
cpu                  usage                             average                   2                   1                rate percent
cpu                  usage                             maximum                   4                   4                rate percent
cpu                  usage                             minimum                   3                   4                rate percent
cpu                  usagemhz                          average                   6                   1                rate megaHertz
cpu                  usagemhz                          maximum                   8                   4                rate megaHertz
cpu                  usagemhz                          minimum                   7                   4                rate megaHertz
cpu                  used                            summation                 111                   3               delta millisecond
disk                 busResets                       summation                 115                   3               delta number
disk                 commands                        summation                 113                   3               delta number
disk                 commandsAborted                 summation                 114                   3               delta number
disk                 deviceLatency                     average                 156                   2            absolute millisecond
disk                 deviceReadLatency                 average                 148                   2            absolute millisecond
disk                 deviceWriteLatency                average                 152                   2            absolute millisecond
disk                 kernelLatency                     average                 157                   2            absolute millisecond
disk                 kernelReadLatency                 average                 149                   2            absolute millisecond
disk                 kernelWriteLatency                average                 153                   2            absolute millisecond
disk                 numberRead                      summation                  91                   3               delta number
disk                 numberWrite                     summation                  92                   3               delta number
disk                 queueLatency                      average                 159                   2            absolute millisecond
disk                 queueReadLatency                  average                 151                   2            absolute millisecond
...

&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
&lt;u&gt;Example QueryInstances&lt;/u&gt;&lt;br /&gt;
&lt;p /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;
$esx = Get-VMHost &amp;lt;ESX-hostname&amp;gt; | Get-View
./Get-Stat2-v1.1.ps1 -entity $esx -stat &amp;quot;disk.deviceLatency.average&amp;quot;,&amp;quot;net.received.average&amp;quot; -queryinstances | ft

&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
produces an array of custom objects like this&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;
Stat                                                                    Instance
----                                                                    --------
disk.deviceLatency.average                                              vmhba0:0:0
disk.deviceLatency.average                                              vmhba0:1:0
disk.deviceLatency.average                                              vmhba32:0:0
disk.deviceLatency.average                                              vmhba32:0:1
disk.deviceLatency.average                                              vmhba32:1:0
disk.deviceLatency.average                                              vmhba32:11:0
disk.deviceLatency.average                                              vmhba32:2:0
disk.deviceLatency.average                                              vmhba32:2:1
disk.deviceLatency.average                                              vmhba32:6:0
disk.deviceLatency.average                                              vmhba32:6:1
disk.deviceLatency.average                                              vmhba32:7:0
disk.deviceLatency.average                                              vmhba32:7:1
disk.deviceLatency.average                                              vmhba32:8:0
net.received.average                                                    vmnic0
net.received.average                                                    vmnic1
net.received.average                                                    vmnic2
net.received.average                                                    vmnic3

&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
&lt;b&gt;Note&lt;/b&gt; that an instance can have a length zero for some metrics.&lt;br /&gt;
This ("") is the instance that returns the aggregated statistics value.&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;
$esx = Get-VMHost &amp;lt;ESX-hostname&amp;gt; | Get-View
./Get-Stat2-v1.1.ps1 -entity $esx -stat &amp;quot;cpu.usage.average&amp;quot; -queryinstances | ft

&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
returns&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;
Stat                                                                    Instance
----                                                                    --------
cpu.usage.average
cpu.usage.average                                                       0
cpu.usage.average                                                       1

&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
The first object in the array is the "aggregate" instance.&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;Update 02/03/09&lt;/u&gt;&lt;br /&gt;
The attached Get-Stat2.ps1 script has been updated.&lt;br /&gt;
The changes:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;corrected issue with missing -Maxsamples parameter&lt;/li&gt;
&lt;li&gt;corrected issue with incorrect instances returned for -QueryInstances&lt;/li&gt;
&lt;li&gt;introduced default value ("RT") for -Interval parameter&lt;/li&gt;
&lt;/ul&gt;</description>
      <pubDate>Tue, 21 Jul 2009 15:18:59 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-10384</guid>
      <dc:date>2009-07-21T15:18:59Z</dc:date>
      <clearspace:dateToText>4 months, 1 week ago</clearspace:dateToText>
      <clearspace:replyCount>1</clearspace:replyCount>
    </item>
    <item>
      <title>Issue getting healthcheck to run manually or scheduled</title>
      <link>http://communities.vmware.com/docs/DOC-10327</link>
      <description>&lt;br /&gt;
Up until ESX 3.5 Update 4 we had the HealthCheck script schedule to run everyday, but since we updated it does not seem to be able to run.&lt;br /&gt;
&lt;p /&gt;
I have tried it manually and recieved this error:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&lt;a class="jive-link-adddocument" href="http://communities.vmware.com/community-document-picker.jspa?communityID=2530&amp;subject=vSphere+PowerCLI"&gt;vSphere PowerCLI&lt;/a&gt; C:\Program Files\VMware\Infrastructure\VIToolkitForWindows\Scripts&amp;gt; dir &lt;br clear="all" /&gt; Directory: Microsoft.PowerShell.Core\FileSystem::C:\Program Files\VMware\Infrastructure\VIToolkitForWindows\Scripts &lt;br clear="all" /&gt; Mode                LastWriteTime     Length Name &lt;br clear="all" /&gt; ----&lt;hr /&gt;&lt;/blockquote&gt;
&lt;hr /&gt;
&lt;ul class="jive-dash"&gt;

&lt;ul class="jive-dash"&gt;

&lt;ul class="jive-dash"&gt;

&lt;ul class="jive-dash"&gt;
&lt;li&gt;&lt;br clear="all" /&gt; -a---          7/7/2009   2:12 PM      16674 Healthcheck.ps1 &lt;br clear="all" /&gt; -a---         4/23/2009   6:56 AM       7771 Initialize-VIToolkitEnvironment.ps1 &lt;br clear="all" /&gt; &lt;a class="jive-link-adddocument" href="http://communities.vmware.com/community-document-picker.jspa?communityID=2530&amp;subject=vSphere+PowerCLI"&gt;vSphere PowerCLI&lt;/a&gt; C:\Program Files\VMware\Infrastructure\VIToolkitForWindows\Scripts&amp;gt; ./Healthcheck.ps1 &lt;br clear="all" /&gt; Incomplete string token. &lt;br clear="all" /&gt; At C:\Program Files\VMware\Infrastructure\VIToolkitForWindows\Scripts\Healthcheck.ps1:121 char:270 &lt;br clear="all" /&gt; +     $vmhosts | Sort Name -Descending | % { $server = $_ |get-view; $server.Config.Product | select { $server.Name }, Version, Build, FullName }| Co &lt;br clear="all" /&gt; nvertTo-Html &amp;acirc;?"body "&amp;lt;H2&amp;gt;$cluster Cluster Information.&amp;lt;/H2&amp;gt;" -head "&amp;lt;link rel='stylesheet' href='style.css' type='text/css' / &amp;lt;&amp;lt;&amp;lt;&amp;lt; &amp;gt;" | Out-File -Ap &lt;br clear="all" /&gt; pend $filelocation &lt;br clear="all" /&gt; &lt;a class="jive-link-adddocument" href="http://communities.vmware.com/community-document-picker.jspa?communityID=2530&amp;subject=vSphere+PowerCLI"&gt;vSphere PowerCLI&lt;/a&gt; C:\Program Files\VMware\Infrastructure\VIToolkitForWindows\Scripts&amp;gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;br /&gt;
Any assistance would be greatly appreciated&lt;br /&gt;
&lt;br /&gt;</description>
      <category domain="http://communities.vmware.com/tags?communityID=2530">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">script</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">vi_toolkit_windows</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">report</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">reporting</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">toolkit</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">vi</category>
      <pubDate>Tue, 07 Jul 2009 19:38:23 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-10327</guid>
      <dc:date>2009-07-07T19:38:23Z</dc:date>
      <clearspace:dateToText>4 months, 3 weeks ago</clearspace:dateToText>
      <clearspace:replyCount>3</clearspace:replyCount>
    </item>
    <item>
      <title>ghettoVCBg2 - Free alternative for backing up VMs in ESX(i) 3.5 and 4.x (no SSH console required!)</title>
      <link>http://communities.vmware.com/docs/DOC-9843</link>
      <description>&lt;h1&gt;Table of Contents:&lt;/h1&gt;
&lt;ul&gt;

&lt;ul&gt;
&lt;li&gt;Description&lt;/li&gt;
&lt;li&gt;Features&lt;/li&gt;
&lt;li&gt;Requirements&lt;/li&gt;
&lt;li&gt;ESX/ESXi Version Support Table&lt;/li&gt;
&lt;li&gt;Setup&lt;/li&gt;
&lt;li&gt;Addings ESX/ESXi host(s) to VIMA/vMA&lt;/li&gt;
&lt;li&gt;Configurations&lt;/li&gt;
&lt;li&gt;Usage&lt;/li&gt;
&lt;li&gt;Sample Execution
&lt;ul&gt;
&lt;li&gt;Backup VMs located in a list&lt;/li&gt;
&lt;li&gt;Backup VMs using individual backup policies &lt;/li&gt;
&lt;li&gt;Dryrun Mode&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Experimental Features&lt;/li&gt;
&lt;li&gt;FAQ&lt;/li&gt;
&lt;li&gt;Change Log&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;h1&gt;Description:&lt;/h1&gt;
&lt;br /&gt;
This tool is the follow up release of the &lt;a class="jive-link-external" href="http://communities.vmware.com/docs/DOC-8760"&gt;ghettoVCB&lt;/a&gt; backup utility which allows users to perform backups of virtual machines residing on &lt;b&gt;ESX(i) 3.5+/4.0+&lt;/b&gt; servers using methodology similar to &lt;a class="jive-link-external" href="http://www.vmware.com/products/vi/consolidated_backup.html"&gt;VMware's VCB&lt;/a&gt; tool. By incorporating highly constructive feedback from the VMware community and utilizing the existing VI API, ghettoVCB’s framework was completely rewritten to be &lt;a class="jive-link-external" href="http://www.youtube.com/watch?v=K2cYWfq--Nw"&gt;harder, better, faster, stronger&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
The primary motivation for ghettoVCBg2 was to provide ESXi users with access to the utility without relying on unlocking and utilizing the unsupported console. To satisfy this requirement, the rebuilt framework takes advantage of the &lt;a class="jive-link-external" href="http://www.vmware.com/support/developer/viperltoolkit/"&gt;VI Perl Toolkit/vSphere SDK for Perl&lt;/a&gt; which is present in the &lt;a class="jive-link-external" href="http://www.vmware.com/support/developer/vima/"&gt;VIMA/vMA&lt;/a&gt; virtual appliance provided by VMware. As a result, ghettoVCBg2 provides a more proper backup solution that administrators can utilize in their virtual infrastructure. &lt;br /&gt;
&lt;br /&gt;
As it stands, it is a requirement that ghettoVCB be invoked directly on each of the ESX servers hosting virtual machines in need of a backup. By taking advantage of VIMA/vMA, the entire backup process becomes centralized in turn eliminating the abovementioned requirement. Additionally, by leveraging the vi-fastpass library, unattended authentication between VIMA/vMA and target ESX servers is made possible. This alleviates the need to continually pass in credentials for each ESX server. &lt;br /&gt;
&lt;br /&gt;
By centralizing the backup process, individual virtual machine backup lists pertaining to their respective ESX(i) servers are no longer required. ghettoVCBg2 has the ability to identify virtual machines and their respective hosts, potentially eliminating any past confusion associated with maintaining multiple lists. &lt;br /&gt;
&lt;br /&gt;
In its current configuration, the script will allow up to 3 unique backups of the Virtual Machine before it will overwrite the previous backups; this however, can be modified to fit procedures if need be. Please be diligent in running the script in a test or staging environment before using it on production live Virtual Machines; this script functions well within our environment but there is a chance that it may not fit well into other environments.&lt;br /&gt;
&lt;br /&gt;
&lt;h1&gt;Features&lt;/h1&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Support for logging (normal &amp;#38; verbose)  &lt;/li&gt;
&lt;li&gt;Single VM backup list across multiple ESX/ESXi host(s)  &lt;/li&gt;
&lt;li&gt;Credential-less backups (so long as host(s) are being managed by VIMA/vMA)  &lt;/li&gt;
&lt;li&gt;Online back up of VM(s)&lt;/li&gt;
&lt;li&gt;Only valid VMDKs presented to the VM will be backed up&lt;/li&gt;
&lt;li&gt;Support for multiple VMDK backup per VM&lt;/li&gt;
&lt;li&gt;Preserve original powerState of VM(s)&lt;/li&gt;
&lt;li&gt;Ability to shutdown guestOS, initiate backup process and power on VM afterwards with the option of hardpower timeout &lt;/li&gt;
&lt;li&gt;Ensure that snapshot removal process completes prior to continuing the backup process&lt;/li&gt;
&lt;li&gt;VM(s) that initially contain &lt;b&gt;snapshots&lt;/b&gt; and &lt;b&gt;Physical RDMs&lt;/b&gt; (raw device mapppings) will not be backed up&lt;/li&gt;
&lt;li&gt;Support for VM(s) with &lt;b&gt;Virtual RDMs&lt;/b&gt; &lt;/li&gt;
&lt;li&gt;Ability to specify the number of backup rotations per VM&lt;/li&gt;
&lt;li&gt;Output back up VMDKs in &lt;b&gt;ZEROEDTHICK&lt;/b&gt; (default behavior), &lt;b&gt;EAGERZEROEDTHICK&lt;/b&gt;, &lt;b&gt;2GB SPARSE&lt;/b&gt; or &lt;b&gt;THIN&lt;/b&gt; format  &lt;/li&gt;
&lt;li&gt;Ouput backup VMDKs using either &lt;b&gt;BUSLOGIC&lt;/b&gt; or &lt;b&gt;LSILOGIC&lt;/b&gt; adapter type &lt;/li&gt;
&lt;li&gt;Fully support VMDKs stored across multiple datastores&lt;/li&gt;
&lt;li&gt;VM snapshot memory and quiesce options &lt;/li&gt;
&lt;li&gt;Individual VM backup policy (supported on ESX(i) 3.5u2+ &amp;#38; ESX(i) 4.x+)&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;span style="color:blue"&gt;Email logs (Experimental Support)&lt;/span&gt;&lt;/b&gt; &lt;b&gt;&lt;span style="color:green"&gt;NEW!&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;span style="color:blue"&gt;Ability to include/exclude specific VMDK(s) per VM (requires individual VM backup policy setup)&lt;/span&gt;&lt;/b&gt; &lt;b&gt;&lt;span style="color:green"&gt;NEW!&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;span style="color:blue"&gt;Independent disk aware (will ignore VMDK)&lt;/span&gt;&lt;/b&gt; &lt;b&gt;&lt;span style="color:green"&gt;NEW!&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;span style="color:blue"&gt;Additional debugging information including dry run execution&lt;/span&gt;&lt;/b&gt; &lt;b&gt;&lt;span style="color:green"&gt;NEW!&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;hr /&gt;
&lt;br /&gt;
&lt;h1&gt;Requirements:&lt;/h1&gt;
VMs running on ESX(i) 3.5u2+ or ESX(i) 4.x+&lt;br /&gt;
VMware VIMA 1.0 or VMware vMA 4.0&lt;br /&gt;
&lt;br /&gt;
&lt;hr /&gt;
&lt;br /&gt;
&lt;h1&gt;ESX/ESXi Version Support Table&lt;/h1&gt;
&lt;br /&gt;
&lt;table class="jive-wiki-table"&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;Version&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;Support&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;Alternative&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ESX 3.5u2&lt;/td&gt;
&lt;td&gt;Requires at least Foundation/Essentials license&lt;/td&gt;
&lt;td&gt;&lt;a class="jive-link-external" href="http://communities.vmware.com/docs/DOC-8760"&gt;ghettoVCB&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ESX 3.5u3&lt;/td&gt;
&lt;td&gt;Requires at least Foundation/Essentials license&lt;/td&gt;
&lt;td&gt;&lt;a class="jive-link-external" href="http://communities.vmware.com/docs/DOC-8760"&gt;ghettoVCB&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ESX 3.5u4&lt;/td&gt;
&lt;td&gt;Requires at least Foundation/Essentials license&lt;/td&gt;
&lt;td&gt;&lt;a class="jive-link-external" href="http://communities.vmware.com/docs/DOC-8760"&gt;ghettoVCB&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ESXi 3.5u2&lt;/td&gt;
&lt;td&gt;Works for free&lt;/td&gt;
&lt;td&gt;&lt;a class="jive-link-external" href="http://communities.vmware.com/docs/DOC-8760"&gt;ghettoVCB&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ESXi 3.5u3&lt;/td&gt;
&lt;td&gt;Works for free&lt;/td&gt;
&lt;td&gt;&lt;a class="jive-link-external" href="http://communities.vmware.com/docs/DOC-8760"&gt;ghettoVCB&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ESXi 3.5u4&lt;/td&gt;
&lt;td&gt;Requires at least Foundation/Essentials license&lt;/td&gt;
&lt;td&gt;&lt;a class="jive-link-external" href="http://communities.vmware.com/docs/DOC-8760"&gt;ghettoVCB&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ESX 4.0&lt;/td&gt;
&lt;td&gt;Requires at least Foundation/Essentials license&lt;/td&gt;
&lt;td&gt;&lt;a class="jive-link-external" href="http://communities.vmware.com/docs/DOC-8760"&gt;ghettoVCB&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ESXi 4.0&lt;/td&gt;
&lt;td&gt;Requires at least Foundation/Essentials license&lt;/td&gt;
&lt;td&gt;&lt;a class="jive-link-external" href="http://communities.vmware.com/docs/DOC-8760"&gt;ghettoVCB&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;br clear="left" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
&lt;br /&gt;
&lt;h1&gt;Setup:&lt;/h1&gt;
&lt;br /&gt;
1) Download &lt;b&gt;ghettoVCBg2.pl&lt;/b&gt; to your VIMA 1.0/vMA 4.0 system&lt;br /&gt;
&lt;br /&gt;
2) Change the permissions on the script to ensure it can be executed:&lt;br /&gt;
&lt;p /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;[vi-admin@scofield ~]$ chmod +x ghettoVCBg2.pl
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;hr /&gt;
&lt;br /&gt;
&lt;h1&gt;Addings ESX/ESXi host(s) to VIMA/vMA&lt;/h1&gt;
&lt;br /&gt;
Prior to starting, ensure that the VMware VIMA/vMA host is managing the appropriate ESX(i) 3.5u2/4.x+ host(s)&lt;br /&gt;
&lt;br /&gt;
1. Add ESXi hosts to VIMA/vMA managment using vifp&lt;br /&gt;
&lt;br /&gt;
A password prompt for the vi-admin account and root password to the pertinent ESXi host(s) will be presented.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;[vi-admin@vima-primp-industries ~]$ sudo vifp addserver olga.resnet.ucsb.edu
root@olga.resnet.ucsb.edu's password:
[vi-admin@vima-primp-industries ~]$
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
2. Verify that the appropriate hosts are being managed by VIMA/vMA&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;[vi-admin@vima-primp-industries ~]$ sudo vifp listservers
olga.resnet.ucsb.edu
himalaya.primp-industries.com
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;hr /&gt;
&lt;br /&gt;
&lt;h1&gt;Configurations&lt;/h1&gt;
&lt;br /&gt;
The following variables (similar to that of ghettoVCB) need to be defined within the script prior to execution. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Defining the datastore in which the backups are stored:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="jive-quote"&gt;
my $VM_BACKUP_DATASTORE = "dlgCore-NFS-bigboi.VM-Backups";&lt;br /&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Defining the name of folder that will contain backups (if folder does not exist, it will automatically be created):&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="jive-quote"&gt;
my $VM_BACKUP_DIRECTORY = "WILLIAM_BACKUPS";&lt;br /&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Defining the backup rotation per VM:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="jive-quote"&gt;
my $VM_BACKUP_ROTATION_COUNT = "3";&lt;br /&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Defining the backup disk format (zeroedthick, eagerzeroedthick, thin, and 2gbsparse are available):&lt;/b&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;div class="jive-quote"&gt;
my $DISK_BACKUP_FORMAT = "zeroedthick";&lt;br /&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Defining the adapter type for backed up VMDK (buslogic, and lsilogic are available):&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="jive-quote"&gt;
my $ADAPTER_FORMAT = "buslogic";&lt;br /&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Defining whether the VM is powered down or not prior to backup (1 = enable, 0 = disable):&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="color:green"&gt;Note: VM(s) that are powered off will not require snapshoting&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div class="jive-quote"&gt;
my $POWER_VM_DOWN_BEFORE_BACKUP = "0";&lt;br /&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Defining whether virtual machine memory is snapped and if quiescing is enabled (1 = enable, 0 = disable):&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="color:green"&gt;Note: By default both are disabled&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div class="jive-quote"&gt;
my $VM_SNAPSHOT_MEMORY = "0";&lt;br /&gt;
my $VM_SNAPSHOT_QUIESCE = "0";&lt;br /&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Defining the detail of logging (verbose or normal):&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="jive-quote"&gt;
my $LOG_LEVEL = "normal";&lt;br /&gt;
&lt;/div&gt;
&lt;br /&gt;
*Defining VMDK(s) to backup from a particular VM either a list of vmdks or "all"&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;VM_VMDK_FILES=&amp;quot;myvmdk.vmdk&amp;quot;
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Experimental Support Configs:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="color:green"&gt;Note: Port 25 by default&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
my $SEND_MAIL = "no";&lt;br /&gt;
my $EMAIL_HOST = "emailserver";&lt;br /&gt;
my $EMAIL_DOMAIN = "localhost.localdomain";&lt;br /&gt;
my $EMAIL_TO = 'William Lam &amp;lt;william@primp-industries.com.com&amp;gt;';&lt;br /&gt;
my $EMAIL_FROM = 'ghettoVCBg2 &amp;lt;ghettoVCBg2@primp-industries.com.com&amp;gt;';&lt;br /&gt;
&lt;p /&gt;
&lt;b&gt;Ensure that you do not edit past this section:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;########################## DO NOT MODIFY PAST THIS LINE ##########################
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;hr /&gt;
&lt;br /&gt;
&lt;h1&gt;Usage:&lt;/h1&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;[vi-admin@scofield ~]$ ./ghettoVCBg2.pl
Required command option 'vmlist' not specified.

Synopsis: ./ghettoVCBg2.pl OPTIONS


Command-specific options:
   --config_dir
      Name of directory containing VM(s) backup configurations
   --dryrun (default '0')
      Set to 1 to enable dryrun mode (default 0)
   --output (default '/tmp/ghettoVCBg2.log')
      Full path to output log (default /tmp/ghettoVCBg2.log)
   --vmlist (required)
      A file containing a list of virtual machine(s) to be backed up on host

Common VI options:
   --config (variable VI_CONFIG)
      Location of the VI Perl configuration file
   --credstore (variable VI_CREDSTORE)
      Name of the credential store file defaults to &amp;lt;HOME&amp;gt;/.vmware/credstore/vicredentials.xml on Linux and &amp;lt;APPDATA&amp;gt;/VMware/credstore/vicredentials.xml on Windows
   --encoding (variable VI_ENCODING, default 'utf8')
      Encoding: utf8, cp936 (Simplified Chinese), iso-8859-1 (German), shiftjis (Japanese)
   --help
      Display usage information for the script
   --passthroughauth (variable VI_PASSTHROUGHAUTH)
      Attempt to use pass-through authentication
   --passthroughauthpackage (variable VI_PASSTHROUGHAUTHPACKAGE, default 'Negotiate')
      Pass-through authentication negotiation package
   --password (variable VI_PASSWORD)
      Password
   --portnumber (variable VI_PORTNUMBER)
      Port used to connect to server
   --protocol (variable VI_PROTOCOL, default 'https')
      Protocol used to connect to server
   --savesessionfile (variable VI_SAVESESSIONFILE)
      File to save session ID/cookie to utilize
   --server (variable VI_SERVER, default 'localhost')
      VI server to connect to. Required if url is not present
   --servicepath (variable VI_SERVICEPATH, default '/sdk/webService')
      Service path used to connect to server
   --sessionfile (variable VI_SESSIONFILE)
      File containing session ID/cookie to utilize
   --url (variable VI_URL)
      VI SDK URL to connect to. Required if server is not present
   --username (variable VI_USERNAME)
      Username
   --verbose (variable VI_VERBOSE)
      Display additional debugging information
   --version
      Display version information for the script

&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="color:red"&gt;Note:&lt;/span&gt;&lt;/b&gt; There are some additional command line arguments that can be provided upon runtime: --debug, --output and --vmlist. &lt;b&gt;--vmlist&lt;/b&gt; is the only parameter required. The rest will have defaults if not explicitly defined. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;--dryrun&lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Dry run information will be written to the log and &lt;u&gt;no&lt;/u&gt; backup will take place&lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;--output&lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Name of the output log, if the same log is used, it will automatically append (ensure you provide full path e.g. /tmp/ghettoVCBg2.log)&lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;--config_dir&lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;This directory will contain the individual VM backup policy files. If a virtual machine has an associated policy file, the global configuration will be ignored for that backup instance. &lt;/li&gt;
&lt;/ul&gt;
&lt;p /&gt;
The input to this script is a file that contains the display name of the virtual machine(s) separated by a newline. When creating this file on a non-Linux/UNIX system, you may introduce a ^M character which may cause the script to misbehave. To ensure that this does not occur, please create the file on the ESX/ESXi host.&lt;br /&gt;
&lt;br /&gt;
Provided is a sample of what the file should contain:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;[vi-admin@scofield ~]$ cat virtual_machine_backup_list
VIMA
vMA-2
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;hr /&gt;
&lt;br /&gt;
&lt;h1&gt;Sample Execution&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;Backup VMs located in a list&lt;/li&gt;
&lt;li&gt;Backup VMs based on individual VM backup policies&lt;/li&gt;
&lt;li&gt;Debug Mode&lt;/li&gt;
&lt;li&gt;Dry run Mode&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;h2&gt;Backup VMs located in a list&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Log verbosity: info (default)&lt;/li&gt;
&lt;li&gt;Log output: /tmp/ghettoVCBg2.log (default)&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;table class="jive-wiki-table"&gt;
&lt;tr&gt;
&lt;td&gt;DISK_FORMAT&lt;/td&gt;
&lt;td&gt;2gbsparse&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ADAPTER_FORMAT&lt;/td&gt;
&lt;td&gt;buslogic&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LOG_LEVEL&lt;/td&gt;
&lt;td&gt;info&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VM_SNAPSHOT_MEMORY&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VM_SNAPSHOT_QUIESCE&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VMS_TO_BACKUP&lt;/td&gt;
&lt;td&gt;(VIMA,vMA-2)&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;br clear="left" /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;[vi-admin@scofield ~]$ ./ghettoVCBg2.pl --vmlist virtual_machine_backup_list

[vi-admin@scofield ~]$ cat /tmp/ghettoVCBg2.log
        11-13-2009 23:34:53 --  info: ============================== ghettoVCBg2 LOG START ==============================
        11-13-2009 23:34:53 --  info: CONFIG - BACKUP_LOG_OUTPUT = /tmp/ghettoVCBg2.log
        11-13-2009 23:34:53 --  info: CONFIG - VM_BACKUP_DATASTORE = dlgCore-NFS-bigboi.VM-Backups
        11-13-2009 23:34:53 --  info: CONFIG - VM_BACKUP_DIRECTORY = WILLIAM_BACKUPS
        11-13-2009 23:34:53 --  info: CONFIG - DISK_BACKUP_FORMAT = 2gbsparse
        11-13-2009 23:34:53 --  info: CONFIG - ADAPTER_FORMAT = buslogic
        11-13-2009 23:34:53 --  info: CONFIG - POWER_VM_DOWN_BEFORE_BACKUP = NO
        11-13-2009 23:34:53 --  info: CONFIG - VM_SNAPSHOT_MEMORY = NO
        11-13-2009 23:34:53 --  info: CONFIG - VM_SNAPSHOT_QUIESCE = NO
        11-13-2009 23:34:53 --  info: CONFIG - VM_BACKUP_DIR_NAMING_CONVENTION = 2009-11-13
        11-13-2009 23:34:53 --  info: CONFIG - VM_VMDK_FILES = all

        11-13-2009 23:34:58 --  info: Initiate backup for VIMA found on himalaya.primp-industries.com
        11-13-2009 23:35:18 --  info: VIMA has 1 VMDK(s)
        11-13-2009 23:37:37 --  info: Backup completed for VIMA!

        11-13-2009 23:37:37 --  info: Initiate backup for vMA-2 found on himalaya.primp-industries.com
        11-13-2009 23:37:47 --  info: vMA-2 has 1 VMDK(s)
        11-13-2009 23:40:07 --  info: Backup completed for vMA-2!

        11-13-2009 23:40:10 --  info: ============================== ghettoVCBg2 LOG END ==============================
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Backup VMs based on individual VM backup policies and log output to /tmp/ghettoVCB.log&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Log verbosity: info (default)&lt;/li&gt;
&lt;li&gt;Log output: /tmp/ghettoVCB.log (default)&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;b&gt;VIMA&lt;/b&gt;&lt;br /&gt;
&lt;table class="jive-wiki-table"&gt;
&lt;tr&gt;
&lt;td&gt;VM_BACKUP_DATASTORE&lt;/td&gt;
&lt;td&gt;dlgCore-NFS-bigboi.VM-Backups&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VM_BACKUP_DIRECTORY&lt;/td&gt;
&lt;td&gt;WILLIAM_BACKUPS&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DISK_FORMAT&lt;/td&gt;
&lt;td&gt;zeroedthick&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ADAPTER_FORMAT&lt;/td&gt;
&lt;td&gt;buslogic&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LOG_LEVEL&lt;/td&gt;
&lt;td&gt;debug&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VM_SNAPSHOT_MEMORY&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VM_SNAPSHOT_QUIESCE&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VM_VMDK_FILES&lt;/td&gt;
&lt;td&gt;VIMA_1.vmdk&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;br clear="left" /&gt;
&lt;br /&gt;
&lt;b&gt;vMA-2&lt;/b&gt;&lt;br /&gt;
&lt;table class="jive-wiki-table"&gt;
&lt;tr&gt;
&lt;td&gt;VM_BACKUP_DATASTORE&lt;/td&gt;
&lt;td&gt;dlgCore-NFS-bigboi.VM-Backups&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VM_BACKUP_DIRECTORY&lt;/td&gt;
&lt;td&gt;vGHETTO_BACKUPS&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DISK_FORMAT&lt;/td&gt;
&lt;td&gt;thin&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ADAPTER_FORMAT&lt;/td&gt;
&lt;td&gt;lsilogic&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LOG_LEVEL&lt;/td&gt;
&lt;td&gt;info&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VM_SNAPSHOT_MEMORY&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VM_SNAPSHOT_QUIESCE&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VM_VMDK_FILES&lt;/td&gt;
&lt;td&gt;all&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;br clear="left" /&gt;
&lt;br /&gt;
1. Create folder to hold individual VM backup policies (can be named anything):&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;[vi-admin@scofield ~]$ mkdir backup_config
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
2. Create individual VM backup policies for each VM and ensure each file is named exactly as the display name of the VM being backed up (use provided template to create duplicates):&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;[vi-admin@scofield backup_config]$ cp ghettoVCBg2-vm_backup_configuration_template VIMA
[vi-admin@scofield backup_config]$ cp ghettoVCBg2-vm_backup_configuration_template vMA-2
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
4. Using a preferred editor (nano or vi), edit each VM backup policy file&lt;br /&gt;
&lt;br /&gt;
Listing of VM backup policy within backup configuration directory&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;[vi-admin@scofield backup_config]$ ls
ghettoVCBg2-vm_backup_configuration_template  VIMA  vMA-2
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
5. Pass in the value, backup_config, into the &lt;b&gt;--config_dir&lt;/b&gt; parameter&lt;br /&gt;
&lt;br /&gt;
(e.g.)&lt;br /&gt;
--config_dir backupConfigs&lt;br /&gt;
&lt;br /&gt;
Example of two distinct VM backup policies will be applied to &lt;b&gt;VIMA&lt;/b&gt; and &lt;b&gt;vMA-2&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Backup policy for "VIMA" (backup only 1 specific VMDKs)&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;[vi-admin@scofield backup_config]$ cat VIMA
VM_BACKUP_DATASTORE = &amp;quot;dlgCore-NFS-bigboi.VM-Backups&amp;quot;
VM_BACKUP_DIRECTORY = &amp;quot;WILLIAM_BACKUPS&amp;quot;
VM_BACKUP_ROTATION_COUNT = &amp;quot;3&amp;quot;
DISK_BACKUP_FORMAT = &amp;quot;zeroedthick&amp;quot;
ADAPTER_FORMAT = &amp;quot;buslogic&amp;quot;
POWER_VM_DOWN_BEFORE_BACKUP = &amp;quot;0&amp;quot;
VM_SNAPSHOT_MEMORY = &amp;quot;1&amp;quot;
VM_SNAPSHOT_QUIESCE = &amp;quot;1&amp;quot;
LOG_LEVEL = &amp;quot;debug&amp;quot;
VM_VMDK_FILES = &amp;quot;VIMA_1.vmdk&amp;quot;
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Backup policy for VM "vMA-2" (backup all VMDKs found)&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;VM_BACKUP_DATASTORE = &amp;quot;dlgCore-NFS-bigboi.VM-Backups&amp;quot;
VM_BACKUP_DIRECTORY = &amp;quot;vGHETTO_BACKUPS&amp;quot;
VM_BACKUP_ROTATION_COUNT = &amp;quot;3&amp;quot;
DISK_BACKUP_FORMAT = &amp;quot;thin&amp;quot;
ADAPTER_FORMAT = &amp;quot;lsilogic&amp;quot;
POWER_VM_DOWN_BEFORE_BACKUP = &amp;quot;0&amp;quot;
VM_SNAPSHOT_MEMORY = &amp;quot;0&amp;quot;
VM_SNAPSHOT_QUIESCE = &amp;quot;0&amp;quot;
LOG_LEVEL = &amp;quot;info&amp;quot;
VM_VMDK_FILES = &amp;quot;all&amp;quot;
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
The following is an output of the script when utilizing the new &lt;b&gt;--config_dir&lt;/b&gt; parameter with debug mode enabled. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="color:red"&gt;Note: --vmlist is still a required parameter with the exception that backup policy files must exist for each VM in the list else the VM will be ignored in the backup process.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Execution of backup&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;[vi-admin@scofield ~]$ ./ghettoVCBg2.pl --config_dir backup_config --vmlist virtual_machine_backup_list

[vi-admin@scofield ~]$ cat /tmp/ghettoVCBg2.log
        11-14-2009 00:18:41 --  info: ============================== ghettoVCBg2 LOG START ==============================
        11-14-2009 00:18:45 --  info: CONFIG - USING CONFIGURATION FILE = VIMA
        11-14-2009 00:18:45 --  info: CONFIG - BACKUP_LOG_OUTPUT = /tmp/ghettoVCBg2.log
        11-14-2009 00:18:45 --  info: CONFIG - VM_BACKUP_DATASTORE = dlgCore-NFS-bigboi.VM-Backups
        11-14-2009 00:18:45 --  info: CONFIG - VM_BACKUP_DIRECTORY = WILLIAM_BACKUPS
        11-14-2009 00:18:45 --  info: CONFIG - DISK_BACKUP_FORMAT = zeroedthick
        11-14-2009 00:18:45 --  info: CONFIG - ADAPTER_FORMAT = buslogic
        11-14-2009 00:18:45 --  info: CONFIG - POWER_VM_DOWN_BEFORE_BACKUP = NO
        11-14-2009 00:18:45 --  info: CONFIG - VM_SNAPSHOT_MEMORY = YES
        11-14-2009 00:18:45 --  info: CONFIG - VM_SNAPSHOT_QUIESCE = YES
        11-14-2009 00:18:45 --  info: CONFIG - VM_BACKUP_DIR_NAMING_CONVENTION = 2009-11-14
        11-14-2009 00:18:45 --  info: CONFIG - VM_VMDK_FILES = VIMA_1.vmdk

        11-14-2009 00:18:45 --  info: Initiate backup for VIMA found on himalaya.primp-industries.com
        11-14-2009 00:18:55 --  debug: VIMA original powerState: poweredOn
        11-14-2009 00:18:55 --  debug: Creating Snapshot &amp;quot;ghettoVCBg2-snapshot-2009-11-14&amp;quot; for VIMA
        11-14-2009 00:19:45 --  info: VIMA has 2 VMDK(s)
        11-14-2009 00:19:45 --  debug: findVMDKFile: Found VMDK File: VIMA_1.vmdk
        11-14-2009 00:19:45 --  debug: backupVMDK: Backing up &amp;quot;[http://himalaya-local-SAS.Savvio|http://himalaya-local-SAS.Savvio] VIMA/VIMA_1.vmdk&amp;quot; to &amp;quot;[http://dlgCore-NFS-bigboi.VM-Backups|http://dlgCore-NFS-bigboi.VM-Backups] WILLIAM_BACKUPS/VIMA/VIMA-2009-11-14/VIMA_1.vmdk&amp;quot;
        11-14-2009 00:19:45 --  debug: backupVMDK: Signal copyThread to start
        11-14-2009 00:19:45 --  debug: backupVMDK: Backup progress: Elapsed time 0 min
        11-14-2009 00:19:45 --  debug: copyTask: Wake up and follow the white rabbit, with status: doCopy
        11-14-2009 00:19:45 --  debug: CopyThread: Start backing up VMDK(s) ...
        11-14-2009 00:19:52 --  debug: copyTask: send copySuccess message ...
        11-14-2009 00:19:52 --  debug: copyTask: waiting for next job and sleep ...
        11-14-2009 00:20:46 --  debug: backupVMDK: Successfully completed backup for [http://himalaya-local-SAS.Savvio|http://himalaya-local-SAS.Savvio] VIMA/VIMA_1.vmdk Elapsed time: 1 min
        11-14-2009 00:20:49 --  debug: Removing Snapshot &amp;quot;ghettoVCBg2-snapshot-2009-11-14&amp;quot; for VIMA
        11-14-2009 00:20:51 --  debug: checkVMBackupRotation: Starting ...
        11-14-2009 00:20:57 --  debug: Purging [http://dlgCore-NFS-bigboi.VM-Backups|http://dlgCore-NFS-bigboi.VM-Backups] WILLIAM_BACKUPS/VIMA/VIMA-2009-11-13--3 due to rotation max
        11-14-2009 00:21:05 --  info: Backup completed for VIMA!

        11-14-2009 00:21:05 --  debug: reConfigureBackupParams: VM - vMA-2
        11-14-2009 00:21:05 --  info: CONFIG - USING CONFIGURATION FILE = vMA-2
        11-14-2009 00:21:05 --  info: CONFIG - BACKUP_LOG_OUTPUT = /tmp/ghettoVCBg2.log
        11-14-2009 00:21:05 --  info: CONFIG - VM_BACKUP_DATASTORE = dlgCore-NFS-bigboi.VM-Backups
        11-14-2009 00:21:05 --  info: CONFIG - VM_BACKUP_DIRECTORY = vGHETTO_BACKUPS
        11-14-2009 00:21:05 --  info: CONFIG - DISK_BACKUP_FORMAT = thin
        11-14-2009 00:21:05 --  info: CONFIG - ADAPTER_FORMAT = lsilogic
        11-14-2009 00:21:05 --  info: CONFIG - POWER_VM_DOWN_BEFORE_BACKUP = NO
        11-14-2009 00:21:05 --  info: CONFIG - VM_SNAPSHOT_MEMORY = NO
        11-14-2009 00:21:05 --  info: CONFIG - VM_SNAPSHOT_QUIESCE = NO
        11-14-2009 00:21:05 --  info: CONFIG - VM_BACKUP_DIR_NAMING_CONVENTION = 2009-11-14
        11-14-2009 00:21:05 --  info: CONFIG - VM_VMDK_FILES = all

        11-14-2009 00:21:05 --  info: Initiate backup for vMA-2 found on himalaya.primp-industries.com
        11-14-2009 00:21:15 --  info: vMA-2 has 1 VMDK(s)
        11-14-2009 00:23:22 --  info: Backup completed for vMA-2!

        11-14-2009 00:23:25 --  info: ============================== ghettoVCBg2 LOG END ==============================
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Dry run Mode (no backup will take place)&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Log verbosity: drymode&lt;/li&gt;
&lt;li&gt;Log output: /tmp/ghettoVCB.log (default)&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;[vi-admin@scofield ~]$ ./ghettoVCBg2.pl --config_dir backup_config --vmlist virtual_machine_backup_list --dryrun 1

[vi-admin@scofield ~]$ cat /tmp/ghettoVCBg2.log
        11-14-2009 00:26:29 --  info: ============================== ghettoVCBg2 LOG START ==============================
        11-14-2009 00:26:34 --  info: CONFIG - USING CONFIGURATION FILE = VIMA
        11-14-2009 00:26:34 --  info: CONFIG - BACKUP_LOG_OUTPUT = /tmp/ghettoVCBg2.log
        11-14-2009 00:26:34 --  info: CONFIG - VM_BACKUP_DATASTORE = dlgCore-NFS-bigboi.VM-Backups
        11-14-2009 00:26:34 --  info: CONFIG - VM_BACKUP_DIRECTORY = WILLIAM_BACKUPS
        11-14-2009 00:26:34 --  info: CONFIG - DISK_BACKUP_FORMAT = zeroedthick
        11-14-2009 00:26:34 --  info: CONFIG - ADAPTER_FORMAT = buslogic
        11-14-2009 00:26:34 --  info: CONFIG - POWER_VM_DOWN_BEFORE_BACKUP = NO
        11-14-2009 00:26:34 --  info: CONFIG - VM_SNAPSHOT_MEMORY = YES
        11-14-2009 00:26:34 --  info: CONFIG - VM_SNAPSHOT_QUIESCE = YES
        11-14-2009 00:26:34 --  info: CONFIG - VM_BACKUP_DIR_NAMING_CONVENTION = 2009-11-14
        11-14-2009 00:26:34 --  info: CONFIG - VM_VMDK_FILES = VIMA_1.vmdk

        11-14-2009 00:26:34 --  info: ---------- DRYRUN DEBUG INFO VIMA ----------
        11-14-2009 00:26:34 --  info: DEBUG - Host Build: VMware ESX 4.0.0 build-164009
        11-14-2009 00:26:34 --  info: DEBUG - Host: himalaya.primp-industries.com
        11-14-2009 00:26:34 --  info: DEBUG - Virtual Machine: VIMA
        11-14-2009 00:26:34 --  info: DEBUG - VM ConfigPath: [http://himalaya-local-SAS.Savvio|http://himalaya-local-SAS.Savvio] VIMA/VIMA.vmx
        11-14-2009 00:26:34 --  info: DEBUG - VMX File: VIMA.vmx
        11-14-2009 00:26:34 --  info: DEBUG - BackupConfigPath: [http://dlgCore-NFS-bigboi.VM-Backups|http://dlgCore-NFS-bigboi.VM-Backups] WILLIAM_BACKUPS/VIMA/VIMA-2009-11-14/VIMA.vmx
        11-14-2009 00:26:34 --  info: DEBUG - BackupPath: [http://dlgCore-NFS-bigboi.VM-Backups|http://dlgCore-NFS-bigboi.VM-Backups] WILLIAM_BACKUPS/VIMA/VIMA-2009-11-14
        11-14-2009 00:26:34 --  info: DEBUG - VM Datastore: himalaya-local-SAS.Savvio
        11-14-2009 00:26:34 --  info: DEBUG - VMDK(s):
        11-14-2009 00:26:34 --  info: DEBUG - [http://himalaya-local-SAS.Savvio|http://himalaya-local-SAS.Savvio] VIMA/VIMA.vmdk
        11-14-2009 00:26:34 --  info: DEBUG - [http://himalaya-local-SAS.Savvio|http://himalaya-local-SAS.Savvio] VIMA/VIMA_1.vmdk
        11-14-2009 00:26:34 --  info: ---------- DRYRUN DEBUG INFO VIMA ----------

        11-14-2009 00:26:34 --  debug: reConfigureBackupParams: VM - vMA-2
        11-14-2009 00:26:34 --  info: CONFIG - USING CONFIGURATION FILE = vMA-2
        11-14-2009 00:26:34 --  info: CONFIG - BACKUP_LOG_OUTPUT = /tmp/ghettoVCBg2.log
        11-14-2009 00:26:34 --  info: CONFIG - VM_BACKUP_DATASTORE = dlgCore-NFS-bigboi.VM-Backups
        11-14-2009 00:26:34 --  info: CONFIG - VM_BACKUP_DIRECTORY = vGHETTO_BACKUPS
        11-14-2009 00:26:34 --  info: CONFIG - DISK_BACKUP_FORMAT = thin
        11-14-2009 00:26:34 --  info: CONFIG - ADAPTER_FORMAT = lsilogic
        11-14-2009 00:26:34 --  info: CONFIG - POWER_VM_DOWN_BEFORE_BACKUP = NO
        11-14-2009 00:26:34 --  info: CONFIG - VM_SNAPSHOT_MEMORY = NO
        11-14-2009 00:26:34 --  info: CONFIG - VM_SNAPSHOT_QUIESCE = NO
        11-14-2009 00:26:34 --  info: CONFIG - VM_BACKUP_DIR_NAMING_CONVENTION = 2009-11-14
        11-14-2009 00:26:34 --  info: CONFIG - VM_VMDK_FILES = all

        11-14-2009 00:26:34 --  info: ---------- DRYRUN DEBUG INFO vMA-2 ----------
        11-14-2009 00:26:34 --  info: DEBUG - Host Build: VMware ESX 4.0.0 build-164009
        11-14-2009 00:26:34 --  info: DEBUG - Host: himalaya.primp-industries.com
        11-14-2009 00:26:34 --  info: DEBUG - Virtual Machine: vMA-2
        11-14-2009 00:26:34 --  info: DEBUG - VM ConfigPath: [http://himalaya-local-SAS.Constellation|http://himalaya-local-SAS.Constellation] vMA-2/vMA-2.vmx
        11-14-2009 00:26:34 --  info: DEBUG - VMX File: vMA-2.vmx
        11-14-2009 00:26:34 --  info: DEBUG - BackupConfigPath: [http://dlgCore-NFS-bigboi.VM-Backups|http://dlgCore-NFS-bigboi.VM-Backups] vGHETTO_BACKUPS/vMA-2/vMA-2-2009-11-14/vMA-2.vmx
        11-14-2009 00:26:34 --  info: DEBUG - BackupPath: [http://dlgCore-NFS-bigboi.VM-Backups|http://dlgCore-NFS-bigboi.VM-Backups] vGHETTO_BACKUPS/vMA-2/vMA-2-2009-11-14
        11-14-2009 00:26:34 --  info: DEBUG - VM Datastore: himalaya-local-SAS.Constellation
        11-14-2009 00:26:34 --  info: DEBUG - VMDK(s):
        11-14-2009 00:26:34 --  info: DEBUG - [http://himalaya-local-SAS.Constellation|http://himalaya-local-SAS.Constellation] vMA-2/vMA-2.vmdk
        11-14-2009 00:26:34 --  info: ---------- DRYRUN DEBUG INFO vMA-2 ----------

        11-14-2009 00:26:37 --  info: ============================== ghettoVCBg2 LOG END ==============================
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;hr /&gt;
&lt;br /&gt;
&lt;h1&gt;FAQ&lt;/h1&gt;
&lt;br /&gt;
&lt;b&gt;1Q:&lt;/b&gt; I have a VM listed in my backup file but no backup of that VM took place. The log stated that the VM could not be found. How could this be? I know that it’s running on host X…&lt;br /&gt;
&lt;b&gt;1A&lt;/b&gt; Ensure the ESX/ESXi host is being managed by VMware VIMA/vMA ( &lt;b&gt;sudo vifp listservers&lt;/b&gt; to verify)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;2Q:&lt;/b&gt; I'm getting error X when using the script or I'm not getting any errors, the backup didn’t even take place. Oh what could be wrong? &lt;br /&gt;
&lt;b&gt;2A:&lt;/b&gt; Please provide the entire output of a manual execution (debug &amp;#38; dry run mode) or if you're logging the output withing \{code\} tags, a short description of your environment and the type of VM(s) you're trying to backup—I will try to provide some assistance.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;3Q:&lt;/b&gt; Can I schedule backups to take place hourly, daily, monthly, yearly?&lt;br /&gt;
&lt;b&gt;3A:&lt;/b&gt; Yes, do a search online for &lt;b&gt;crontab&lt;/b&gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;4Q:&lt;/b&gt; I want to schedule my backup on Windows, how do I do this?&lt;br /&gt;
&lt;b&gt;4A:&lt;/b&gt; Do a search for &lt;b&gt;plink&lt;/b&gt;. Make sure you have paired SSH keys setup between your Windows system and VIMA/vMA.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;5Q:&lt;/b&gt; Do I have to use VMware VIMA/vMA to initiate the backup?&lt;br /&gt;
&lt;b&gt;5A:&lt;/b&gt; Yes, vi-fastpass is being used and only VIMA/vMA provides this capability. However, you can kickoff the process from another host (*nix/win)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;6Q:&lt;/b&gt; I only have a single ESXi host. I want to take backups and store them somewhere else. The problem is: I don't have NFS, iSCSI nor FC SAN. What can I do?&lt;br /&gt;
&lt;b&gt;6A:&lt;/b&gt; You can use local storage to store your backups assuming that you have enough space on the destination datastore.  Afterwards, you can use scp (WinSCP/FastSCP) or &lt;b&gt;vifs&lt;/b&gt; (vCLI) to transfer the backups from the ESXi host to your local desktop.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;7Q:&lt;/b&gt; I’m pissed; the backup is taking too long. My datastore is of type X?&lt;br /&gt;
&lt;b&gt;7A:&lt;/b&gt; YMMV, take a look at your storage configuration and make sure it is optimized.  &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;8Q:&lt;/b&gt; I noticed that the backup rotation is occurring after a backup. I don't have enough local storage space, can the process be changed?&lt;br /&gt;
&lt;b&gt;8A:&lt;/b&gt; This is primarily done to ensure that you have at least one good backup in case the new backup fails. If you would like to modify the script, you're more than welcome to do so. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;9Q:&lt;/b&gt; What is the best storage configuration for datastore type X?&lt;br /&gt;
&lt;b&gt;9A:&lt;/b&gt; Search the VMTN forums; there are various configurations for the different type of storage/etc.  &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;10Q:&lt;/b&gt; I want to setup NFS Server to run my backups. Which is the best and should it be virtual or physical?&lt;br /&gt;
&lt;b&gt;10A:&lt;/b&gt; Please refer to answer 7A. From experience, we’ve seen physical instances of NFS servers to be faster than their virtual counterparts.  As always, YMMV. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;11Q:&lt;/b&gt; When I try to use the script I get an error stating: &lt;b&gt;"restricted version"&lt;/b&gt;. What the heck is this?&lt;br /&gt;
&lt;b&gt;11A:&lt;/b&gt; Please take a look at the &lt;b&gt;ESX/ESXi Version Support Table&lt;/b&gt; in this document. The reason is explained &lt;a class="jive-link-external" href="http://vmetc.com/2009/03/31/esxi-u4-ends-free-version-read-and-write-access-from-the-rcli/"&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;12Q:&lt;/b&gt; I'm getting error X when using the script or I'm not getting any errors, the backup didn’t even take place. Oh what could be wrong? &lt;br /&gt;
&lt;b&gt;12A:&lt;/b&gt; First, you'll want to check the log (default /tmp/ghettoVCBg2) and see if there are any obvious errors. If not, please provide the entire output of the log, a short description of your environment and the type of VM(s) you're trying to backup—I will try to provide some assistance.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;13Q:&lt;/b&gt; I have VMs that have snapshots. I want to back these things up but the script doesn’t let me do it. How do I fix that?&lt;br /&gt;
&lt;b&gt;13A:&lt;/b&gt; VM snapshots are not meant to be kept for long durations. When backing up a VM that contains a snapshot, you should ensure all snapshots have been committed prior to running a backup. No exceptions will be made…ever.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;14Q:&lt;/b&gt; I would like to restore from backup, what is the best method?&lt;br /&gt;
&lt;b&gt;14A:&lt;/b&gt; The restore process will be unique for each environment and should be determined by your backup/recovery plans. At a high level you have the option of mounting the backup datastore and registering the VM in question or copy the VM from the backup datastore to the ESX/ESXi host. The latter is recommended so that you're not running a VM living on the backup datastore or inadvertently modifying your backup VM(s).  &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;15Q:&lt;/b&gt; When using the experimental feature: &lt;b&gt;Individual VM backup policy&lt;/b&gt;, if I don't have a policy will it use the default configurations defined in the script?&lt;br /&gt;
&lt;b&gt;15A:&lt;/b&gt; No, this use case will not be supported, ever. If you decide to use the per VM policy, then the global configuration in the script is ignored. If a VM policy config is not found, the VM will not be backed up even if it's in the &lt;b&gt;–-vmlist&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;16Q:&lt;/b&gt; In vMA 4.0, vCenter target will be supported, can I just add vCenter target and assume this will work?&lt;br /&gt;
&lt;b&gt;16A:&lt;/b&gt; At the moment, this is not a supported feature. You will need to add each ESX/ESXi host for the vi-fastpass library to be able to locate the host(s).&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;17Q:&lt;/b&gt; When I try to run the script I get: &lt;b&gt;"-bash: ./ghettoVCBg2.pl: Permission denied"&lt;/b&gt;, what is wrong?&lt;br /&gt;
&lt;b&gt;17A:&lt;/b&gt; You need to change the permission on the script to be executable, chmod +x ghettoVCBg2.pl&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;18Q:&lt;/b&gt; Where can I download the latest version of the script?&lt;br /&gt;
&lt;b&gt;18A:&lt;/b&gt; The latest version is available on this page at the bottom. To get the version of the script run &lt;b&gt;./ghettoVCBg2.pl --version&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;hr /&gt;
&lt;br /&gt;
&lt;h1&gt;Change Log&lt;/h1&gt;
&lt;br /&gt;
11/18/09 - New variable "EMAIL_DOMAIN" was added for email log functionality as email domain must be defined or left as default "localhost.localdomain". Thanks to adrian888 for finding this bug&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;my $EMAIL_DOMAIN = &amp;quot;localhost.localdomain&amp;quot;;
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
11/17/09 - The following enhancements and fixes have been implemented in this release of ghettoVCBg2. Special thanks goes out to &lt;b&gt;Gerhard Ostermann&lt;/b&gt; for assisting with some of the logic in the ghettoVCBg2 script and the rest of the ghettoVCBg2 BETA testers. Thanks for everyones time and comments to make this script better!&lt;br /&gt;
&lt;br /&gt;
Enhancements:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Email log support&lt;/li&gt;
&lt;li&gt;Include/exclude specific VMDK(s)&lt;/li&gt;
&lt;li&gt;Additional logging + dry run mode&lt;/li&gt;
&lt;/ul&gt;
&lt;p /&gt;
Fixes:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Independent disk aware&lt;/li&gt;
&lt;li&gt;Large VMDK backups&lt;/li&gt;
&lt;/ul&gt;</description>
      <category domain="http://communities.vmware.com/tags?communityID=2687">vcb</category>
      <category domain="http://communities.vmware.com/tags?communityID=2687">backup</category>
      <category domain="http://communities.vmware.com/tags?communityID=2687">vm_backup</category>
      <category domain="http://communities.vmware.com/tags?communityID=2687">esx3.5</category>
      <category domain="http://communities.vmware.com/tags?communityID=2687">vima</category>
      <category domain="http://communities.vmware.com/tags?communityID=2687">vima1.0</category>
      <category domain="http://communities.vmware.com/tags?communityID=2687">vma</category>
      <category domain="http://communities.vmware.com/tags?communityID=2687">vma4.0</category>
      <category domain="http://communities.vmware.com/tags?communityID=2687">vghettovcb</category>
      <category domain="http://communities.vmware.com/tags?communityID=2687">esx3.5</category>
      <category domain="http://communities.vmware.com/tags?communityID=2687">esx4</category>
      <category domain="http://communities.vmware.com/tags?communityID=2687">esxi_3.5</category>
      <category domain="http://communities.vmware.com/tags?communityID=2687">esxi_4</category>
      <category domain="http://communities.vmware.com/tags?communityID=2687">esxi_4</category>
      <pubDate>Thu, 23 Apr 2009 04:36:49 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-9843</guid>
      <dc:date>2009-04-23T04:36:49Z</dc:date>
      <clearspace:dateToText>6 days, 17 hours ago</clearspace:dateToText>
      <clearspace:replyCount>110</clearspace:replyCount>
    </item>
    <item>
      <title>VI Remote CLI 3.5 Update 2</title>
      <link>http://communities.vmware.com/docs/DOC-9823</link>
      <description>&lt;br /&gt;
Remote CLI commands allow you to perform many of the operations you might currently perform using the ESX 3 service console. You can use Remote CLI commands in scripts that run on ESXi 3.5 and ESX 3.5 hosts.  Remote CLI commands are especially useful for an ESXi host because ESXi does not include a service console.&lt;br /&gt;
&lt;p /&gt;
Links for VMware Infrastructure Remote Command‐Line Interface (Remote CLI) version 3.5 Update 2:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a class="jive-link-external" href="http://www.vmware.com/pdf/vi3_35/esx_3/r35u2/vi3_35_25_u2_rcli.pdf"&gt;Remote CLI 3.5 Update 2 documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="jive-link-external" href="http://www.vmware.com/download/download.do?downloadGroup=VI-RCLI-U2"&gt;Remote CLI 3.5 Update 2 software&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p /&gt;</description>
      <pubDate>Tue, 21 Apr 2009 18:45:25 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-9823</guid>
      <dc:date>2009-04-21T18:45:25Z</dc:date>
      <clearspace:dateToText>7 months, 1 week ago</clearspace:dateToText>
    </item>
    <item>
      <title>E-Mail Alert for Datastores</title>
      <link>http://communities.vmware.com/docs/DOC-9663</link>
      <description />
      <category domain="http://communities.vmware.com/tags?communityID=2530">automation</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">get-datastore</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">free</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">space</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">email</category>
      <pubDate>Mon, 09 Mar 2009 17:40:25 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-9663</guid>
      <dc:date>2009-03-09T17:40:25Z</dc:date>
      <clearspace:dateToText>8 months, 3 weeks ago</clearspace:dateToText>
    </item>
    <item>
      <title>Portgroup - how to configure Nic Teaming</title>
      <link>http://communities.vmware.com/docs/DOC-9564</link>
      <description />
      <category domain="http://communities.vmware.com/tags?communityID=2530">portgroup</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">nic</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">teaming</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">sdk</category>
      <pubDate>Sun, 22 Feb 2009 01:48:00 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-9564</guid>
      <dc:date>2009-02-22T01:48:00Z</dc:date>
      <clearspace:dateToText>9 months, 6 days ago</clearspace:dateToText>
    </item>
    <item>
      <title>ESX/ESXi APC/APCUPSD Host Shutdown VI Perl Toolkit Script (ghettoShutdown.pl/upsVIShutdown.pl)</title>
      <link>http://communities.vmware.com/docs/DOC-9531</link>
      <description>&lt;h2&gt;Description&lt;/h2&gt;
Many parties have looked for the possibility of monitoring power continuity and subsequently reacting to power outages with information supplied by a UPS agent installed in a virtual machine running on a free version of ESXi. Currently, one free solution &lt;a class="jive-link-external" href="http://viops.vmware.com/home/docs/DOC-1341"&gt;How to configure ESXi to shutdown using an APC SmartUPS&lt;/a&gt; created by Joseph Holland facilitates shutdown/suspend procedures for online virtual machines in the event of a power outage given that there is some type of physical UPS system in place to provide backup power to the ESXi server. Joseph&amp;rsquo;s solution utilizes &lt;a class="jive-link-external" href="http://www.vmware.com/support/developer/vima/"&gt;VMware VIMA&lt;/a&gt; and the open source utility &lt;a class="jive-link-external" href="http://www.apcupsd.com/"&gt;apcupsd&lt;/a&gt; however, one needs to enable the unsupported SSH console in ESXi and setup paired SSH keys between VIMA and host to utilize it. Enabling the unsupported SSH console may not be the preferred method for some end users with respect to their support contracts held with VMware. &lt;br /&gt;
&lt;br /&gt;
The following solution outlined in this document is similar to Joseph&amp;rsquo;s work although it will not necessitate enabling the unsupported SSH console on the ESXi hosts. This is made possible by utilizing the VI Perl Toolkit to communicate with the ESXi hosts. The only possible drawback however is that next revision of ESXi may disallow write operations and require that the user purchase ESXi license(s) to make full use of the VI API (read/write).&lt;br /&gt;
&lt;br /&gt;
It must be pointed out that this implementation is built on top of initial findings made by Joseph Holland (&lt;a class="jive-link-external" href="http://viops.vmware.com/home/docs/DOC-1341"&gt;APC VIOPS documentation&lt;/a&gt;) and Andrew Sullivan (&lt;a class="jive-link-external" href="http://get-admin.com/blog/?p=361"&gt;VMware VIMA VI Fastpass disection&lt;/a&gt;). Please do visit Andrew&amp;rsquo;s blog at &lt;a class="jive-link-external" href="http://get-admin.com/"&gt;get-admin&lt;/a&gt;. Thanks to &lt;a class="jive-link-external" href="http://twitter.com/depping"&gt;Duncan Epping&lt;/a&gt; for nudging the challenge via Twitter &lt;img class="jive-emoticon" border="0" src="http://communities.vmware.com/images/emoticons/wink.gif" alt=";)" /&gt;...&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Note: Please ensure proper testing has been performed in a staging or development environment prior to implementing this solution in a production environment.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Requirements&lt;/h2&gt;
ESX/ESXi 3.5+&lt;br /&gt;
VMware VIMA&lt;br /&gt;
VI Perl Toolkit (included in VIMA)&lt;br /&gt;
APC SmartUPS or other "smart" UPS (may require another monitoring utility)&lt;br /&gt;
&lt;a class="jive-link-external" href="http://downloads.sourceforge.net/apcupsd/apcupsd-3.14.5-1.el5.x86_64.rpm?modtime=1231876603&amp;#38;big_mirror=0"&gt;apcupsd-3.14.5-1.el5.x86_64.rpm&lt;/a&gt; (VMware VIMA is 64bit RHEL VM)&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Usage&lt;/h2&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;[vi-admin@vima-ups-dev ~]$ ./ghettoShutdown.pl
Required command option 'ups_vm' not specified.

Synopsis: ./ghettoShutdown.pl OPTIONS


Command-specific options:
   --sleep
      The amount of time (secs) to wait after a guestOS shutdown (default 15 secs)
   --ups_vm (required)
      The name of VM that is monitoring your UPS

Common VI options:
   --config (variable VI_CONFIG)
      Location of the VI Perl configuration file
   --encoding (variable VI_ENCODING, default 'utf8')
      Encoding: utf8, cp936 (Simplified Chinese), iso-8859-1 (German), shiftjis (Japanese)
   --help
      Display usage information for the script
   --passthroughauth (variable VI_PASSTHROUGHAUTH)
      Attempt to use pass-through authentication
   --passthroughauthpackage (variable VI_PASSTHROUGHAUTHPACKAGE, default 'Negotiate')
      Pass-through authentication negotiation package
   --password (variable VI_PASSWORD)
      Password
   --portnumber (variable VI_PORTNUMBER)
      Port used to connect to server
   --protocol (variable VI_PROTOCOL, default 'https')
      Protocol used to connect to server
   --savesessionfile (variable VI_SAVESESSIONFILE)
      File to save session ID/cookie to utilize
   --server (variable VI_SERVER, default 'localhost')
      VI server to connect to. Required if url is not present
   --servicepath (variable VI_SERVICEPATH, default '/sdk/webService')
      Service path used to connect to server
   --sessionfile (variable VI_SESSIONFILE)
      File containing session ID/cookie to utilize
   --url (variable VI_URL)
      VI SDK URL to connect to. Required if server is not present
   --username (variable VI_USERNAME)
      Username
   --verbose (variable VI_VERBOSE)
      Display additional debugging information
   --version
      Display version information for the script
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
&lt;h2&gt;Overview of the scripts:&lt;/h2&gt;
&lt;u&gt;ghettoShutdown.pl&lt;/u&gt; - This script initiates the shutdown of all VM(s) within an ESX/ESXi host excluding the virtual machine that's monitoring the UPS device and then shutdowns the host. It accepts two commandline parameters: &lt;b&gt;--sleep&lt;/b&gt; the duration in seconds to wait after a VM has initiated the shutdown before moving onto the next VM &lt;b&gt;(shutdownVM() is non-blocking function)&lt;/b&gt; and &lt;b&gt;--ups_vm&lt;/b&gt; the name of the displayName of your VM that is monotiring the UPS device [more details to come later]. &lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;upsVIShutdown.pl&lt;/u&gt; - This script is a wrapper which will hold the configurations of the order of hosts to shutdown. It may be used inconjunction with other UPS monitoring utility, though with our example, it'll be placed in the &lt;b&gt;apccontrol&lt;/b&gt; script to execute upon a power interuption. &lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Scenario&lt;/h2&gt;
2 ESXi 3.5u3 (free unlicensed edition):&lt;br /&gt;
&lt;br /&gt;
&lt;table class="jive-wiki-table"&gt;
&lt;tr&gt;
&lt;th&gt;superion.primp-industries.com&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SQL-PROD-01&lt;/td&gt;
&lt;td&gt;Powered On&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Quentin&lt;/td&gt;
&lt;td&gt;Powered Off&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;air_raid&lt;/td&gt;
&lt;td&gt;Powered On&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;skydive&lt;/td&gt;
&lt;td&gt;Suspended&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;fireflight&lt;/td&gt;
&lt;td&gt;Powered Off&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;slingshot&lt;/td&gt;
&lt;td&gt;Powered On&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;br clear="left" /&gt;
&lt;br /&gt;
&lt;table class="jive-wiki-table"&gt;
&lt;tr&gt;
&lt;th&gt;devastator.primp-industries.com&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VIMA-UPS-DEV&lt;/td&gt;
&lt;td&gt;Powered On&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;bonecrusher&lt;/td&gt;
&lt;td&gt;Powered Off&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;master_mix&lt;/td&gt;
&lt;td&gt;Suspended&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;quickMigrate-X&lt;/td&gt;
&lt;td&gt;Powered Off&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;scavenger&lt;/td&gt;
&lt;td&gt;Suspended&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;hook&lt;/td&gt;
&lt;td&gt;Powered On&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;long_haul&lt;/td&gt;
&lt;td&gt;Powered On&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;br clear="left" /&gt;
&lt;br /&gt;
Simulate a power interuption and initiate shutdown of &lt;b&gt;superion&lt;/b&gt; and it's VM(s) then &lt;b&gt;devastator&lt;/b&gt; and its VM(s) using VMware VIMA: VIMA-UPS-DEV. &lt;b&gt;&lt;span style="color:blue"&gt;(note, due to the lack of our UPS being configured, this will be a simulation of the UPS utility initiate the shutdown)&lt;/span&gt;&lt;/b&gt; &lt;br /&gt;
&lt;br /&gt;
Since the script is written using the VI Perl Toolkit, this potentially could function on a Windows VM installed with the VI Perl Toolkit but you will not able to use VI Fastpass for authentication and credentials will need to be passed to &lt;b&gt;ghettoShutdown.pl&lt;/b&gt; via the execution. &lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Setup&lt;/h2&gt;
1. Ensure your ESX/ESXi host(s) are being managed by VMware VIMA&lt;br /&gt;
&lt;br /&gt;
2. Download &lt;b&gt;ghettoShutdown.pl&lt;/b&gt; and save to /home/vi-admin and make sure it has executable permissions set (chmod +x ghettoShutdown.pl)&lt;br /&gt;
&lt;br /&gt;
3. Download &lt;b&gt;upsVIShutdown.pl&lt;/b&gt; and save to /home/vi-admin and make sure it has executable permissions set (chmod +x upsVIShutdown.pl)&lt;br /&gt;
&lt;br /&gt;
4. Edit the following sections in &lt;b&gt;upsVIShutdown.pl&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
A) Insert your ESX/ESXi host(s), use the hostname that you used to add to VIMA managment interface, if you're unsure run &lt;b&gt;sudo vifp listservers&lt;/b&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="color:red"&gt;Remember to make sure the host that is running your VIMA VM is listed as the last entry.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div class="jive-quote"&gt;my @hosts = ("superion.primp-industries.com","devastator.primp-industries.com");B) Modify the logoutput of the shutdown process if you like, default will go to /tmp/upsShutdown.log&lt;/div&gt;
&lt;br /&gt;
&lt;div class="jive-quote"&gt;my $log_output = "/tmp/upsShutdown.log";C) Insert the displayName of VIMA or VM that is monitoring your UPS device (case sensitive)&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="color:red"&gt;Very important step else you could end up shutting down the VM that is executing this script, we wouldn't want that&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div class="jive-quote"&gt;my $ups_vm_name = "VIMA-UPS-DEV";D) Insert the number of seconds to delay after a guestOS has initiated to be shutdown, this will vary depending on the type of applications the VM(s) may be running, tweak this value as needed.&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="color:red"&gt;Note, the shutdownVM() is a non-blocking function, if you set the delay to be too short the host could be powered down before the VM(s) have completed powering off (default 15 secs)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div class="jive-quote"&gt;my $sec_to_sleep = 15;Next, you'll want to install the apcupsd client on your VMware VIMA host with the following command:&lt;/div&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;sudo rpm -ivh apcupsd-3.14.5-1.el5.x86_64.rpm
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
You'll then need to configure your apcupsd.conf and you use the following &lt;a class="jive-link-external" href="http://viops.vmware.com/home/docs/DOC-1341"&gt;document&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Next, instead of setting up a SSH paired keys and inserting the ssh command in &lt;b&gt;/etc/apcupsd/apccontrol&lt;/b&gt;, you'll be appending the following:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;doshutdown)
	echo &amp;quot;UPS ${2} initiated Shutdown Sequence&amp;quot; | ${WALL}
	/home/vi-admin/upsVIShutdown.pl 
	${SHUTDOWN} -h now &amp;quot;apcupsd UPS ${2} initiated shutdown&amp;quot;
;;
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
I don't think the 3rd line is really ncessary since the VM will be on the same host that'll be shutting down. &lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Sample output&lt;/h2&gt;
1. We'll now manually initate the &lt;b&gt;upsVIShutdown.pl&lt;/b&gt; script as if a power interuption was detected by apcupsd client. &lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;[vi-admin@vima-ups-dev ~]$ ./upsVIShutdown.pl
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
2. As you can see from above...nothing too fancy, though the process has been kicked off and both host(s) and their VM(s) have been powered down in the order of our configuration file. To verify the output, we will power on our hosts, log into VIMA-UPS-DEV (the VM that initiated the shutdown process) and inspect the logs containing the shutdown process at &lt;b&gt;/tmp/upsShutdown.log&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;[vi-admin@vima-ups-dev ~]$ cat /tmp/upsShutdown.log
04-25-2008 11:17:52 -- Found ESX/ESXi host: superion.primp-industries.com!
        04-25-2008 11:17:52 -- Begin shutdown process ...
        04-25-2008 11:18:07 -- VM: slingshot shutdown succssfully.
        04-25-2008 11:18:22 -- VM: air_raid shutdown succssfully.
        04-25-2008 11:18:37 -- VM: silverbolt shutdown succssfully.
        04-25-2008 11:18:37 -- VM: skydive is already suspended.
        04-25-2008 11:18:37 -- VM: fireflight is already off.
        04-25-2008 11:18:44 -- VM: SQL-PROD-01 hard poweroff succssful (No VMware Tools, bad admin).
        04-25-2008 11:18:44 -- VM: Quentin is already off.
        04-25-2008 11:18:44 -- HOST: superion.primp-industries.com is shutting down!

04-25-2008 11:18:49 -- Found ESX/ESXi host: devastator.primp-industries.com!
        04-25-2008 11:18:49 -- Begin shutdown process ...
        04-25-2008 11:18:49 -- VM: scavenger is already suspended.
        04-25-2008 11:18:49 -- VM: bonecrusher is already off.
        04-25-2008 11:18:49 -- VM: master_mix is already suspended.
        04-25-2008 11:18:56 -- VM: scrapper hard poweroff succssful (No VMware Tools, bad admin).
        04-25-2008 11:19:04 -- VM: long_haul hard poweroff succssful (No VMware Tools, bad admin).
        04-25-2008 11:19:11 -- VM: hook hard poweroff succssful (No VMware Tools, bad admin).
        04-25-2008 11:19:11 -- VM: quickMigrate-X is already off.
        04-25-2008 11:19:12 -- Shutting down final host: devastator.primp-industries.com and UPS VM: VIMA-UPS-DEV!
==============================================================================================
&lt;/code&gt;&lt;/pre&gt;</description>
      <category domain="http://communities.vmware.com/tags?communityID=2687">vima</category>
      <category domain="http://communities.vmware.com/tags?communityID=2687">vmware_vima</category>
      <category domain="http://communities.vmware.com/tags?communityID=2687">apc</category>
      <category domain="http://communities.vmware.com/tags?communityID=2687">apcupsd</category>
      <category domain="http://communities.vmware.com/tags?communityID=2687">shutdown_script</category>
      <category domain="http://communities.vmware.com/tags?communityID=2687">vi_perl_toolkit</category>
      <pubDate>Mon, 16 Feb 2009 08:51:14 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-9531</guid>
      <dc:date>2009-02-16T08:51:14Z</dc:date>
      <clearspace:dateToText>2 months, 2 days ago</clearspace:dateToText>
      <clearspace:replyCount>19</clearspace:replyCount>
    </item>
    <item>
      <title>list virtual machines per cluster</title>
      <link>http://communities.vmware.com/docs/DOC-9506</link>
      <description>&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;$clusters = get-cluster

foreach ($cluster in $clusters)
{
    foreach ($vmhost in ($cluster | get-vmhost))
    {
        $vmhost | get-vm | Select-Object @{Name=&amp;quot;Cluster&amp;quot;; Expression={$cluster.name}},`
            Name
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
&lt;a href="http://www.vmwarescripting.com"&gt;http://www.vmwarescripting.com&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
This document was generated from the following thread:&amp;nbsp;&lt;a href="http://communities.vmware.com/thread/192793" class="jive-link-thread"&gt;list virtual machines per cluster&lt;/a&gt;</description>
      <pubDate>Tue, 10 Feb 2009 14:32:32 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-9506</guid>
      <dc:date>2009-02-10T14:32:32Z</dc:date>
      <clearspace:dateToText>9 months, 2 weeks ago</clearspace:dateToText>
      <clearspace:replyCount>1</clearspace:replyCount>
    </item>
    <item>
      <title>Here is a PowerShell script to list datastore information per cluster</title>
      <link>http://communities.vmware.com/docs/DOC-9505</link>
      <description>&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;$clusters = get-cluster
aforeach ($cluster in $clusters)
{
    $vmhosts = $cluster | get-vmhost
    $firsthost = $vmhosts[0]
    $datastores = $firsthost | get-datastore | % {(Get-View $_.ID).summary}
    foreach ($datastore in $datastores)
    {
        $datastore | select-object @{Name = &amp;quot;Date&amp;quot;; Expression = {get-date}}, @{Name = &amp;quot;Cluster&amp;quot;; Expression = {$cluster.name}}, URL, Name, Freespace, Capacity
           }
        }
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;a href="http://www.vmwarescripting.com"&gt;http://www.vmwarescripting.com&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
This document was generated from the following thread:&amp;nbsp;&lt;a href="http://communities.vmware.com/thread/191835" class="jive-link-thread"&gt;Here is a PowerShell script to list datastore information per cluster&lt;/a&gt;</description>
      <pubDate>Tue, 10 Feb 2009 14:31:42 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-9505</guid>
      <dc:date>2009-02-10T14:31:42Z</dc:date>
      <clearspace:dateToText>9 months, 2 weeks ago</clearspace:dateToText>
    </item>
    <item>
      <title>get the socket/core info for each vmware host</title>
      <link>http://communities.vmware.com/docs/DOC-9504</link>
      <description>&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;Get-VMHost | %{Get-View $_.ID} | %{
  $name = $_.name
  $esx = &amp;quot;&amp;quot; | select NumCpuPackages, NumCpuCores, Hz, Memory
  $esx.NumCpuPackages = $_.Hardware.CpuInfo.NumCpuPackages 
  $esx.NumCpuCores = $_.Hardware.CpuInfo.NumCpuCores
  $esx | select-object @{Name = &amp;quot;Name&amp;quot;; Expression = {$name}}, @{Name = &amp;quot;Sockets&amp;quot;; Expression = {$esx.NumCpuPackages}}, @{Name = &amp;quot;Cores&amp;quot;; Expression = {$esx.NumCpuCores}}
  }
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
&lt;br /&gt;
&lt;a href="http://www.vmwarescripting.com"&gt;http://www.vmwarescripting.com&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
This document was generated from the following thread:&amp;nbsp;&lt;a href="http://communities.vmware.com/thread/192806" class="jive-link-thread"&gt;get the socket/core info for each vmware host&lt;/a&gt;</description>
      <pubDate>Tue, 10 Feb 2009 14:30:59 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-9504</guid>
      <dc:date>2009-02-10T14:30:59Z</dc:date>
      <clearspace:dateToText>9 months, 2 weeks ago</clearspace:dateToText>
    </item>
    <item>
      <title>Compare hostname of VM with display name of VM</title>
      <link>http://communities.vmware.com/docs/DOC-9503</link>
      <description>&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;$VMs = Get-VM
foreach ($VM in $VMs){
	$VM = Get-View $VM.ID
	$nm = $VM.name
    $hn = $VM.guest.hostname 
    $vm | select @{Name = &amp;quot;Name&amp;quot;; Expression = {$nm}}, @{Name = &amp;quot;Hostname&amp;quot;; Expression = {$hn}}
    }
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.vmwarescripting.com"&gt;http://www.vmwarescripting.com&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
This document was generated from the following thread:&amp;nbsp;&lt;a href="http://communities.vmware.com/thread/192811" class="jive-link-thread"&gt;Compare hostname of VM with display name of VM&lt;/a&gt;</description>
      <pubDate>Tue, 10 Feb 2009 14:30:36 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-9503</guid>
      <dc:date>2009-02-10T14:30:36Z</dc:date>
      <clearspace:dateToText>9 months, 2 weeks ago</clearspace:dateToText>
    </item>
    <item>
      <title>Find HA/DRS status of each host in cluster</title>
      <link>http://communities.vmware.com/docs/DOC-9502</link>
      <description>&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;Get-Cluster | Get-View | %{
  foreach($h in $_.Host){
      Write-Host $_.name
      Write-Host &amp;quot;`tDRS enabled : &amp;quot; $_.Configuration.DRSConfig.Enabled
      Write-Host &amp;quot;`tHA enabled  : &amp;quot; $_.Configuration.DasConfig.Enabled
    }
  }
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;a href="http://www.vmwarescripting.com"&gt;http://www.vmwarescripting.com&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
This document was generated from the following thread:&amp;nbsp;&lt;a href="http://communities.vmware.com/thread/193571" class="jive-link-thread"&gt;Find HA/DRS status of each host in cluster&lt;/a&gt;</description>
      <pubDate>Tue, 10 Feb 2009 14:30:22 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-9502</guid>
      <dc:date>2009-02-10T14:30:22Z</dc:date>
      <clearspace:dateToText>9 months, 2 weeks ago</clearspace:dateToText>
    </item>
    <item>
      <title>verify licensed features of a vmware host</title>
      <link>http://communities.vmware.com/docs/DOC-9501</link>
      <description>&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;$vmhostname = &amp;quot;vmhostname.domain.com&amp;quot;
Connect-VIServer $vmhostname | Out-Null
$vmhost = get-vmhost
$ServiceInstance = Get-View ServiceInstance
$LicManRef=$ServiceInstance.Content.LicenseManager
$LicManView=Get-View $LicManRef
$LicManView.featureinfo | Where-Object {$_.state -eq &amp;quot;enabled&amp;quot;} | `
    Select-Object      @{Name = &amp;quot;VMHost&amp;quot;; Expression = {$vmhost.name}},`
                       @{Name = &amp;quot;License Server&amp;quot;; Expression = {$licManView.source.LicenseServer}},`
                       @{Name = &amp;quot;Version&amp;quot;; Expression = {$licManView.LicensedEdition}},`
                       @{Name = &amp;quot;Feature&amp;quot;; Expression = {$_.key}}
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
This document was generated from the following thread:&amp;nbsp;&lt;a href="http://communities.vmware.com/thread/193570" class="jive-link-thread"&gt;verify licensed features of a vmware host&lt;/a&gt;</description>
      <pubDate>Tue, 10 Feb 2009 14:29:35 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-9501</guid>
      <dc:date>2009-02-10T14:29:35Z</dc:date>
      <clearspace:dateToText>9 months, 2 weeks ago</clearspace:dateToText>
    </item>
    <item>
      <title>find left over VCB snapshots</title>
      <link>http://communities.vmware.com/docs/DOC-9500</link>
      <description>&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;Get-VM | Get-Snapshot | `
    Where-Object {$_.Name -eq &amp;quot;_VCB-BACKUP_&amp;quot;} | `
	Select Name, @{Name=&amp;quot;VM Name&amp;quot; ; `
	Expression={$_.VM.Name}}
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
&lt;a href="http://www.vmwarescripting.com"&gt;http://www.vmwarescripting.com&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
This document was generated from the following thread:&amp;nbsp;&lt;a href="http://communities.vmware.com/thread/193569" class="jive-link-thread"&gt;find left over VCB snapshots&lt;/a&gt;</description>
      <pubDate>Tue, 10 Feb 2009 14:28:54 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-9500</guid>
      <dc:date>2009-02-10T14:28:54Z</dc:date>
      <clearspace:dateToText>9 months, 2 weeks ago</clearspace:dateToText>
    </item>
    <item>
      <title>Export/import baselines from one Update Manager server to another</title>
      <link>http://communities.vmware.com/docs/DOC-9471</link>
      <description />
      <pubDate>Mon, 09 Feb 2009 14:36:52 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-9471</guid>
      <dc:date>2009-02-09T14:36:52Z</dc:date>
      <clearspace:dateToText>9 months, 2 weeks ago</clearspace:dateToText>
      <clearspace:replyCount>12</clearspace:replyCount>
    </item>
    <item>
      <title>set-vi3-entity switch code for scripts</title>
      <link>http://communities.vmware.com/docs/DOC-9425</link>
      <description />
      <category domain="http://communities.vmware.com/tags?communityID=2530">vitoolkit</category>
      <pubDate>Wed, 04 Feb 2009 20:38:15 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-9425</guid>
      <dc:date>2009-02-04T20:38:15Z</dc:date>
      <clearspace:dateToText>9 months, 3 weeks ago</clearspace:dateToText>
    </item>
    <item>
      <title>Live Cloning with Powershell - Across Clusters/Hosts</title>
      <link>http://communities.vmware.com/docs/DOC-9422</link>
      <description>&lt;b&gt;I have written a script that will clone a live vm from one cluster to another (Across Datacenters or Local).&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;To understand what is happeing I will explain our environment and then what this is used for:&lt;/b&gt;&lt;br /&gt;
&lt;blockquote&gt;&lt;b&gt;Environment:&lt;/b&gt; &lt;br clear="all" /&gt;	Consists of 3 Clusters spanning 2 DataCenters (2 in NYC, 1 in NJ) &lt;br clear="all" /&gt;	All Managed by a single VirtualCenter Server(VM) &lt;br clear="all" /&gt;	All ESX Hosts are HP BL680c G5 fully Loaded and are attached to HP EVA 8K's with multiple Fiber Connection/Paths. &lt;br clear="all" /&gt;	All Network connections are aggregated for maximum bandwith (Minimum 4 connection per VLAN). &lt;br clear="all" /&gt;&lt;b&gt;So now what the scripts are used for:&lt;/b&gt; &lt;br clear="all" /&gt;	On a daily basis we have a need to clone a set of VM's to our Hot/Hot/DR site. (Each site acts as DR to the other for specific applications and some application are spanned/Load Balanced between the two. &lt;br clear="all" /&gt;	The first file SC_DR_E.cfg established what work to do by setting the details for the other scripts to interprit. &lt;br clear="all" /&gt;	The Second file SC_DR.ps1 determines if its an Odd or Even day (As we keep online 2 days working of clones in case anything failed we alway have backup at both locations.). &lt;br clear="all" /&gt;	Third file SC_CloneVM_Task.ps1 does the actual work and if requested send a ASCII email with the output during the process. &lt;br clear="all" /&gt;	If you have any questions post them to this forum and I am sure someone will answer your questions.&lt;/blockquote&gt;
&lt;b&gt;Enjoy!&lt;/b&gt;&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;br /&gt;
&lt;b&gt;This document was generated from the following thread:&lt;/b&gt; &lt;a class="jive-link-thread" href="http://communities.vmware.com/thread/180822"&gt;Live Cloning with Powershell - Across Clusters/Hosts not working (Help! Please!)&lt;/a&gt;</description>
      <category domain="http://communities.vmware.com/tags?communityID=2530">live</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">cloning</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">vmclone</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">dr</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">cluster</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">automation</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">vitoolkit</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">script</category>
      <pubDate>Tue, 03 Feb 2009 21:05:09 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-9422</guid>
      <dc:date>2009-02-03T21:05:09Z</dc:date>
      <clearspace:dateToText>9 months, 3 weeks ago</clearspace:dateToText>
    </item>
    <item>
      <title>Report on all VMs with snapshots</title>
      <link>http://communities.vmware.com/docs/DOC-9297</link>
      <description>&lt;br /&gt;
Snapshots are one of those things that tend to get created and then forgotten over time until you run out of disk space and can't quite figure out why. The script below will give you a handy way to generate a tabular report showing all of your VMs that have snapshots and when they were created. Its a quick "two liner", with the first line just getting you connected to your VC, and the 2nd line doing the heavy lifting of enumerating all of the VMs, finding the shapshots, looking up what host currently houses the VM and then creating the actual table&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;connect-viserver &lt;i&gt;VCServerName&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;get-vm | get-snapshot | Select-Object VM, Name, Description, PowerState, Created, @{Name="Host"; Expression = {(Get-VM $_.VM).Host.Name}} | ft -auto&lt;/li&gt;
&lt;/ol&gt;
The output looks like&lt;br /&gt;
&lt;br /&gt;
&lt;table class="jive-wiki-table"&gt;
&lt;tr&gt;
&lt;td&gt;VM&lt;/td&gt;
&lt;td&gt;Name&lt;/td&gt;
&lt;td&gt;Description&lt;/td&gt;
&lt;td&gt;PowerState&lt;/td&gt;
&lt;td&gt;Created&lt;/td&gt;
&lt;td&gt;Host&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;S5&lt;/td&gt;
&lt;td&gt;Pre 4.1 Upgrades&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;PoweredOn&lt;/td&gt;
&lt;td&gt;11/21/2008 7:13:27 AM&lt;/td&gt;
&lt;td&gt;abc.domain.com&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;W2K3-Router&lt;/td&gt;
&lt;td&gt;Test Snapshot&lt;/td&gt;
&lt;td&gt;Test description&lt;/td&gt;
&lt;td&gt;PoweredOn&lt;/td&gt;
&lt;td&gt;1/8/2009 1:12:10 AM&lt;/td&gt;
&lt;td&gt;abc.domain.com&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;BT&lt;/td&gt;
&lt;td&gt;Pre WSS&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;PoweredOff&lt;/td&gt;
&lt;td&gt;8/10/2008 11:38:37 PM&lt;/td&gt;
&lt;td&gt;def.domain.com&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;br clear="left" /&gt;</description>
      <category domain="http://communities.vmware.com/tags?communityID=2530">snapshot</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">reporting</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">powershell</category>
      <pubDate>Sun, 11 Jan 2009 04:45:51 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-9297</guid>
      <dc:date>2009-01-11T04:45:51Z</dc:date>
      <clearspace:dateToText>10 months, 2 weeks ago</clearspace:dateToText>
      <clearspace:replyCount>1</clearspace:replyCount>
    </item>
    <item>
      <title>VMotion Check</title>
      <link>http://communities.vmware.com/docs/DOC-9191</link>
      <description />
      <category domain="http://communities.vmware.com/tags?communityID=2530">vmotion</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">report</category>
      <pubDate>Mon, 15 Dec 2008 15:31:35 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-9191</guid>
      <dc:date>2008-12-15T15:31:35Z</dc:date>
      <clearspace:dateToText>11 months, 2 weeks ago</clearspace:dateToText>
      <clearspace:replyCount>1</clearspace:replyCount>
    </item>
    <item>
      <title>NARPC (Not Another Resource Pool Copier)</title>
      <link>http://communities.vmware.com/docs/DOC-8400</link>
      <description>This script copies a hierarchical tree of resource pools from one cluster to another.&lt;br /&gt;
&lt;br /&gt;
It can easily be adapted to not to use Clusters as the starting point.&lt;br /&gt;
&lt;br /&gt;
As usual, use at your own risk.&lt;br /&gt;
&lt;br /&gt;
Oct 27: &lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;The script now optionally copies resource group permissions thanks to work by ekjreci and lucd.&lt;/li&gt;
&lt;li&gt;The script also tries to use cmdlet/function like command-line arguments (e.g., -FromCluster cluster) when calling scripts and will prompt for 'from' and 'to' cluster names&lt;/li&gt;
&lt;/ul&gt;</description>
      <pubDate>Thu, 23 Oct 2008 12:55:39 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-8400</guid>
      <dc:date>2008-10-23T12:55:39Z</dc:date>
      <clearspace:dateToText>1 year, 4 weeks ago</clearspace:dateToText>
    </item>
    <item>
      <title>NADUS (Not Another Data Upload Script)</title>
      <link>http://communities.vmware.com/docs/DOC-8381</link>
      <description>In the environment we are working in, we want our CDROM images to be available from shared storage accessible from any ESX server, but for various reasons (corporate standards mostly, although network utilization and additional protocols on the ESX server were a factor) didn't want to use NFS or SMB.  Also, because this is the first VMware deployment for this organization, the change management organizations don't want to use templates and therefore want to build VM's using the same processes as for their metal servers.  Hence the need for the ISOs.  Finally, we didn't want to have to teach the Configuration Management/Package Deployment people how to use WinSCP to upload ISOs.&lt;br /&gt;
&lt;br /&gt;
So this script:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Goes through a Windows folder tree which has been populated with media by our configuration management/deployment folks.&lt;/li&gt;
&lt;li&gt;Replicates that tree into a VMFS datastore which is implemented on our SAN and published to all our ESX servers.&lt;/li&gt;
&lt;li&gt;Uploads any file it finds in the windows folder tree to the corresponding folder on the VMFS partition&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
You will never use this script as written, however there may be useful concepts such as: &lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;how to upload files to VMware datastores.  These techniques can be adapted to uploading data to other targets such as the ESX hosts URL&lt;/li&gt;
&lt;li&gt;how to find the datacenter a store is located in&lt;/li&gt;
&lt;li&gt;how to use recursion in powershell functions&lt;/li&gt;
&lt;li&gt;find out where the Datastore psdrive is useful and where it might be tweaked in a future version&lt;/li&gt;
&lt;li&gt;how to upload to a VC-aware datastore using only your current windows credentials.  Note that if your ESX/ESXi server is not part of a VC environment, you will need valid ESX credentials&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
This script borrows extensively from the cmdlets Carter Shanklin has uploaded to &lt;a class="jive-link-external" href="http://www.codeplex.com/vitoolkitextensions"&gt;www.codeplex.com/vitoolkitextensions&lt;/a&gt;.  He and I worked together on the upload bit, and we found that the upload function requires as much memory as the largest file being uploaded.  In this case, we want to upload some pretty decent sized ISO's so this wasn't feasible since things break when you run out of memory.  The functions in this script are modified slightly to use a modest fixed amount of memory, however the upload does take significantly longer than the code in the VIToolkitExtensions  (about 10minutes for a 500MB ISO).&lt;br /&gt;
&lt;br /&gt;
This is far from perfect:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;It doesn't remove anything from the VMFS side&lt;/li&gt;
&lt;li&gt;The upload speed could be improved, but we haven't had the time to play with that&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
Please use this at your own risk.  No guarantee it will work.</description>
      <category domain="http://communities.vmware.com/tags?communityID=2530">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">script</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">datastore</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">upload</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">esx</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">esxi</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">vitoolkit_windows</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">psdrive</category>
      <pubDate>Wed, 22 Oct 2008 19:40:24 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-8381</guid>
      <dc:date>2008-10-22T19:40:24Z</dc:date>
      <clearspace:dateToText>1 year, 1 month ago</clearspace:dateToText>
    </item>
    <item>
      <title>NARMD (Not Another Removable Media Disconnector)</title>
      <link>http://communities.vmware.com/docs/DOC-8350</link>
      <description>We are using this script to provide a slightly more user-friend CDROM and floppy disconnect environment. &lt;br /&gt;
&lt;p /&gt;
You can easily disconnect all CDROMS with &lt;br /&gt;
&lt;p /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;Get-VM | Get-CDROMDrive | Set-CDROMDrive -Connected $False -Confirm:$False
&lt;/code&gt;&lt;/pre&gt; &lt;br /&gt;
&lt;p /&gt;
However you have little control over the above process, and might disconnect things that are actually in use. This script presents a list of VM's whose CDROM(s) or Floppie(s) are connected now, or are set to connect at startup, then prompts the operator to continue. &lt;br /&gt;
&lt;p /&gt;
If the operator confirms the action, it will go ahead and disconnect all the CDROMs and Floppies and uncheck the Connect At Startup, but at least the operator knows what's happening. &lt;br /&gt;
&lt;p /&gt;
If you want a log file you can invoke this as follows: &lt;br /&gt;
&lt;p /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;.\removableDrives.ps1 | Tee-Object C:\Logs\removableDrives.log
&lt;/code&gt;&lt;/pre&gt; &lt;br /&gt;
&lt;p /&gt;
Here's a sample console session (up to the prompt) &lt;br /&gt;
&lt;p /&gt;
&lt;span style="font-family:courier new"&gt;&lt;br /&gt;
VM: Server1 (PoweredOff)&lt;br /&gt;
  CD/DVD Drive 1 Connected=True ConnectAtPowerUp=True&lt;br /&gt;
  Floppy Drive 1 Connected=False ConnectAtPowerUp=False&lt;br /&gt;
VM: Server2 (PoweredOff)&lt;br /&gt;
  CD/DVD Drive 1 Connected=True ConnectAtPowerUp=True&lt;br /&gt;
  Floppy Drive 1 Connected=True ConnectAtPowerUp=True&lt;br /&gt;
VM: Workstation3 (PoweredOff)&lt;br /&gt;
  CD/DVD Drive 1 Connected=True ConnectAtPowerUp=True&lt;br /&gt;
  Floppy Drive 1 Connected=False ConnectAtPowerUp=False&lt;br /&gt;
VM: DomainController1 (PoweredOn)&lt;br /&gt;
  CD/DVD Drive 1 Connected=True ConnectAtPowerUp=True&lt;br /&gt;
  Floppy Drive 1 Connected=False ConnectAtPowerUp=True&lt;br /&gt;
Do you want to disconnect all removable drives, and disable the connect&lt;br /&gt;
  at startup?  If you don't see any VMs everything is OK and you should&lt;br /&gt;
  select N here.  Type Y or N:&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;p /&gt;
The script is here for full-text searching, and is also attached. &lt;br /&gt;
&lt;p /&gt;
&lt;div class="jive-quote"&gt;&lt;span style="font-family:courier new"&gt;"removableDrives.ps1 Version 1.0a starting" &lt;br /&gt;
connect-viserver ($env:computername + "." + $env:userdnsdomain) | out-null &lt;br /&gt;
&lt;p /&gt;
Get-Vm | Where-Object {&lt;br /&gt;
(((Get-CDDrive -VM $_ | Where-Object { (($_.ConnectionState.Connected -eq $True) -or ($_.ConnectionState.StartConnected -eq $True))} ) -ne $Null) `&lt;br /&gt;
-or `&lt;br /&gt;
((Get-FloppyDrive -VM $_ | Where-Object { (($_.ConnectionState.Connected -eq $True) -or ($_.ConnectionState.StartConnected -eq $True))} ) -ne $Null))&lt;br /&gt;
} | %{&lt;br /&gt;
"VM: " + $_.Name + " (" + $_.PowerState + ")"&lt;br /&gt;
Get-CDDrive -VM $_ | ForEach-Object { " " + $_.Name + " Connected=" + $_.ConnectionState.Connected + " ConnectAtPowerUp=" + $_.ConnectionState.StartConnected }&lt;br /&gt;
Get-FloppyDrive -VM $_ | ForEach-Object { " " + $_.Name + " Connected=" + $_.ConnectionState.Connected + " ConnectAtPowerUp=" + $_.ConnectionState.StartConnected }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
if ("Y" -eq (Read-Host `&lt;br /&gt;
("Do you want to disconnect all removable drives, and disable the connect `n" + `&lt;br /&gt;
" at startup? If you don't see any VMs everything is OK and you should `n" + `&lt;br /&gt;
" select N here. Type Y or N"))) {&lt;br /&gt;
Get-Vm | Where-Object {&lt;br /&gt;
(((Get-CDDrive -VM $_ | Where-Object { (($_.ConnectionState.Connected -eq $True) -or ($_.ConnectionState.StartConnected -eq $True))} ) -ne $Null) `&lt;br /&gt;
-or `&lt;br /&gt;
((Get-FloppyDrive -VM $_ | Where-Object { (($_.ConnectionState.Connected -eq $True) -or ($_.ConnectionState.StartConnected -eq $True))} ) -ne $Null))&lt;br /&gt;
} | %{&lt;br /&gt;
"VM: " + $_.Name + " (" + $_.PowerState + ")"&lt;br /&gt;
Get-CDDrive -VM $_ | ForEach-Object { Set-CDDRIVE -CD $_ -StartConnected $False -Connected $False -Confirm:$False | %{ " Changed " + $_.Name} }&lt;br /&gt;
Get-FloppyDrive -VM $_ | ForEach-Object { Set-FloppyDRIVE -Floppy $_ -StartConnected $False -Connected $False -Confirm:$False | %{ " Changed " + $_.Name} }&lt;br /&gt;
}&lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
"removableDrives.ps1 finished."&lt;/span&gt;&lt;/div&gt;</description>
      <category domain="http://communities.vmware.com/tags?communityID=2530">automation</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">cdrom</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">script</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">set-cddrive</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">script</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">powershell</category>
      <pubDate>Tue, 21 Oct 2008 16:58:25 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-8350</guid>
      <dc:date>2008-10-21T16:58:25Z</dc:date>
      <clearspace:dateToText>1 year, 1 month ago</clearspace:dateToText>
    </item>
    <item>
      <title>NAEPS (Not Another ESX Provisioning Script)</title>
      <link>http://communities.vmware.com/docs/DOC-8170</link>
      <description>This script builds on the excellent work done by lberc and others in the forums and at VMware&lt;br /&gt;
&lt;br /&gt;
We are deploying VC+ESX to a somewhat interesting environment:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;engineering is not directly involved in provisioning so it needs to be as automated as possible within a cost-effective constraint&lt;/li&gt;
&lt;li&gt;security is important&lt;/li&gt;
&lt;li&gt;We're using ESX not ESXi&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
The scripts I found stopped too soon for my O-C taste, so this one goes a bit further than others I found including:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Configure the license server&lt;/li&gt;
&lt;li&gt;Upload signed SSL key and certificate files to the ESX server&lt;/li&gt;
&lt;li&gt;Rename all local datastores to try to reduce the accidental deployment to local stores&lt;/li&gt;
&lt;li&gt;Configure the firewall for NTP and updateManager&lt;/li&gt;
&lt;li&gt;Targeted for ESX although there is also a nod to ESXi provisioning&lt;/li&gt;
&lt;li&gt;Configure the environment for our special case where the VCS-ESX communications are on an isolated network&lt;/li&gt;
&lt;/ul&gt;
and a separate isolated VMotion network&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Rescan the HBAs&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
It does the "usual" stuff borrowed from lberc and others:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;reset the root password&lt;/li&gt;
&lt;li&gt;configure networks&lt;/li&gt;
&lt;li&gt;joining to VCS servers&lt;/li&gt;
&lt;li&gt;configuring NTP, DNS, domain, name, IP's etc.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
Some interesting concepts explored here, although hints of topics on these throughout the forums&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Upload files to an https server with a self-signed SSL certificate&lt;/li&gt;
&lt;li&gt;Finding the local datastores on an ESX server&lt;/li&gt;
&lt;li&gt;Accessing and modifying the firewall configuration&lt;/li&gt;
&lt;li&gt;Dealing with Passwords entered with the Read-Host -asSecureString&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
Some caveats&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;This is my first significant Powershell, .Net and VI project. I am sure many of you will cringe when you look at the arcane methods I found.&lt;/li&gt;
&lt;li&gt;We do a manual install of ESX rather than using kickstart. I expect we'll head towards ESXi and this work wouldn't have paid back. This script is run immediately after the reboot following the installation.&lt;/li&gt;
&lt;li&gt;It works pretty well in our target environment, but there is no guarantee or warranty it will work in yours.&lt;/li&gt;
&lt;li&gt;The upload stuff works here works for fairly small files. (file size=memory consumed) Carter Shanklin and I are&lt;/li&gt;
&lt;/ul&gt;
working to improve the upload process. Watch Carter's (c_shanklin) blog and his VI Toolkit Extensions at &lt;a class="jive-link-external" href="http://www.codeplex.com/vitoolkitextensions"&gt;http://www.codeplex.com/vitoolkitextensions&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
A few features for the next version of this script - perhaps in another life:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;It should really attach the server to an Update Manager baseline and remediate.&lt;/li&gt;
&lt;li&gt;Replace all the anachronisms with the best-practice methods&lt;/li&gt;
&lt;li&gt;Configure a VMKernel network and gateway on the Management VLAN&lt;/li&gt;
&lt;li&gt;A way cool Windows.Forms with drop-down lists to capture the information&lt;/li&gt;
&lt;li&gt;Automatically download backup ESXi configuration file to the local disk&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
Oct 16 2008&lt;br /&gt;
&lt;br /&gt;
I meant to mention how to generate a log file but forgot.&lt;br /&gt;
&lt;br /&gt;
As you may have noticed all the messages in this script are simply dumped to the console, rather than explicitly output with Write-Host.  You can redirect this to a log file and still see the console messages by invoking the script as follows:&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;.\configureESX.ps1 | Tee-Object .\configureESX-server.log
&lt;/code&gt;&lt;/pre&gt;</description>
      <category domain="http://communities.vmware.com/tags?communityID=2530">esx</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">esxi</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">3.5</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">vi_toolkit_windows</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">ssl</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">license</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">upload</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">provision</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">script</category>
      <pubDate>Sat, 11 Oct 2008 02:48:55 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-8170</guid>
      <dc:date>2008-10-11T02:48:55Z</dc:date>
      <clearspace:dateToText>1 year, 1 month ago</clearspace:dateToText>
    </item>
    <item>
      <title>Script: Map RDMs to VMs using Uuids and vm names imported from CSV</title>
      <link>http://communities.vmware.com/docs/DOC-7951</link>
      <description />
      <category domain="http://communities.vmware.com/tags?communityID=2530">new-harddisk</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">rdm</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">vitoolkit</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">storage</category>
      <pubDate>Thu, 25 Sep 2008 15:43:28 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-7951</guid>
      <dc:date>2008-09-25T15:43:28Z</dc:date>
      <clearspace:dateToText>1 year, 2 months ago</clearspace:dateToText>
    </item>
    <item>
      <title>Nic Teaming Policy</title>
      <link>http://communities.vmware.com/docs/DOC-7133</link>
      <description>I have another question based on the example of adding a virtual switch.  What if you also wanted to set the nicTeaming policy of the vSwitch to loadbalance_ip  and network failover detection to Link Status Only?  I see that those properities are under HostNetworkPolicy, but I'm not sure how you would use that to add that information to this.  I'm probably just making this a lot harder than it actually is.&lt;br /&gt;
&lt;br /&gt;
$HS = Find-EntityView -ViewType "HostSystem" &lt;br /&gt;
$nwSys = $HS.ConfigManager.NetworkSystem &lt;br /&gt;
$mor = Get-View -MoRef $nwSys &lt;br /&gt;
$networkConfig = New-Object Vmware.Vim.HostNetworkConfig &lt;br /&gt;
$vswtch = New-Object VMware.Vim.HostVirtualSwitchConfig &lt;br /&gt;
$networkConfig.vswitch = @($vswtch) &lt;br /&gt;
$networkConfig.vswitch[0].name = "SwitchName" &lt;br /&gt;
$spec = New-Object Vmware.Vim.HostVirtualSwitchSpec &lt;br /&gt;
$spec.numPorts = 1 &lt;br /&gt;
$portgrp = New-Object VMware.Vim.HostPortGroupConfig &lt;br /&gt;
$networkConfig.portgroup = @($portgrp) &lt;br /&gt;
$portgropspec = New-Object VMware.Vim.HostPortGroupSpec &lt;br /&gt;
$portgropspec.vswitchName = "SwitchName" &lt;br /&gt;
$portgropspec.Name = "SwitchNamePort" &lt;br /&gt;
$portgropspec.Policy = New-Object VMware.Vim.HostNetworkPolicy &lt;br /&gt;
$networkConfig.vswitch[0].spec = $spec &lt;br /&gt;
$networkConfig.portgroup[0].spec = $portgropspec &lt;br /&gt;
$mor.AddVirtualSwitch("SwitchName",$spec ) $mor.AddPortGroup($portgropspec)&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
Thanks,Jaime&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;hr /&gt;
As you probably know NIC teaming can be defined on the switch and on the portgroup.&lt;br /&gt;
This example shows how it is done on a portgroup like you asked.&lt;br /&gt;
I left out the vSwitch objects and method so as not confuse you.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-java"&gt;
$HS = Get-View -ViewType &lt;font color="red"&gt;&amp;quot;HostSystem&amp;quot;&lt;/font&gt; -Filter @&lt;font color="navy"&gt;{&lt;/font&gt;&lt;font color="red"&gt;&amp;quot;Name&amp;quot;&lt;/font&gt; = &amp;lt;ESX-name&amp;gt;&lt;font color="navy"&gt;}&lt;/font&gt;
$nwSys = $HS.ConfigManager.NetworkSystem
$mor = Get-View $nwSys
 
$portgropspec = New-Object VMware.Vim.HostPortGroupSpec
$portgropspec.vswitchName = &amp;lt;vswitch-name&amp;gt;
$portgropspec.Name = &amp;lt;portgroup-name&amp;gt;
 
$portgropspec.Policy = New-Object VMware.Vim.HostNetworkPolicy
 
$portgropspec.Policy.NicTeaming = New-Object VMware.Vim.HostNicTeamingPolicy
$portgropspec.Policy.NicTeaming.failureCriteria = New-Object VMware.Vim.HostNicFailureCriteria
$portgropspec.Policy.NicTeaming.failureCriteria.checkBeacon = $false
$portgropspec.Policy.NicTeaming.failureCriteria.checkDuplex = $false
$portgropspec.Policy.NicTeaming.failureCriteria.checkErrorPercent = $false
 
$portgropspec.Policy.NicTeaming.nicOrder = New-Object VMware.Vim.HostNicOrderPolicy
$portgropspec.Policy.NicTeaming.nicOrder.activeNic = @(&amp;lt;NIC1-name&amp;gt;)
$portgropspec.Policy.NicTeaming.nicOrder.standbyNic = @(&amp;lt;NIC2-name&amp;gt;)
$portgropspec.Policy.NicTeaming.policy = &lt;font color="red"&gt;&amp;quot;loadbalance_ip&amp;quot;&lt;/font&gt;
 
$mor.AddPortGroup($portgropspec)
&amp;nbsp;
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
Note1: in v1 of the VITK the functionality of the Find-EntityView cmdlet has been replaced by the Get-View cmdlet&lt;br /&gt;
Note2: for &amp;lt;vswitch-name&amp;gt; you use the name of an existing switch&lt;br /&gt;
Note3: "Link Status Only" is the default setting. All flags in the failureCriteria object are set to $false&lt;br /&gt;
Note4: for NIC1-name and NIC2-name you use 2 NICs that are already allocated to the vswitch&lt;br /&gt;
Note5: the choice for Active-Active or Active-Standby is up to you. If you place the 2 NICs in the activeNic array , as @(&amp;lt;NIC1-name&amp;gt;,&amp;lt;NIC2-name&amp;gt;), you will have Active-Active teaming.&lt;br /&gt;
&lt;p /&gt;
&lt;hr /&gt;
Awesome, thanks for helping me out again.  I am using v1 so I have been using the Get-View cmlet.  I just copied the example from the FAQ page. &lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
Jaime&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
This document was generated from the following thread: &lt;a class="jive-link-thread" href="http://communities.vmware.com/thread/163401"&gt;Nic Teaming Policy&lt;/a&gt;</description>
      <pubDate>Mon, 18 Aug 2008 15:30:44 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-7133</guid>
      <dc:date>2008-08-18T15:30:44Z</dc:date>
      <clearspace:dateToText>1 year, 3 months ago</clearspace:dateToText>
    </item>
    <item>
      <title>How To: Configure freshly booted ESX with PowerShell</title>
      <link>http://communities.vmware.com/docs/DOC-7132</link>
      <description>As part of a larger project I've been working on a set of scripts which configure a freshly-installed ESX (or ESXi) system into Virtual Center (after first attempting to remove previous VC state and clean state from the host).  Currently they follow a typical post-boot configuration pattern:&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Set ESX password&lt;/li&gt;
&lt;li&gt;Add to Virtual Center cluster&lt;/li&gt;
&lt;li&gt;Configure Virtual Switches&lt;/li&gt;
&lt;li&gt;Configure Port Groups&lt;/li&gt;
&lt;li&gt;Add NFS partitions&lt;/li&gt;
&lt;li&gt;Add iSCSI partitions&lt;/li&gt;
&lt;li&gt;Configure NTP&lt;/li&gt;
&lt;li&gt;Configure VMotion&lt;/li&gt;
&lt;/ol&gt;
Before trying, modify esx-master.ps1 and esx-profile.ps1 to local conditions (or your password will be set to "CHANGEME").&lt;br /&gt;
&lt;br /&gt;
Command: esx-autoconfigure.ps1 "hostname|ip-address"&lt;br /&gt;
&lt;br /&gt;
As this is my initial foray into PowerShell, please excuse any idiosyncracies. &lt;br /&gt;
&lt;br /&gt;
This is a work-in-progress - feedback welcome.  Points awarded for the best suggestions in the next few days. &lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
lance&lt;br /&gt;
&lt;p /&gt;
(See &lt;a class="jive-link-wiki" href="http://communities.vmware.com/docs/DOC-7512" title="How to PXE boot and automatically configure Stateless VMware ESXi Server.  The configuration tools will also work against ESX Classic."&gt;boot/config doc).&lt;/a&gt;&lt;hr /&gt;
My comments are as follows:&lt;br /&gt;
&lt;br /&gt;
1. &lt;a class="jive-link-external" href="http://www.vmware.com/landing_pages/toolkit_contest.html"&gt;http://www.vmware.com/landing_pages/toolkit_contest.html&lt;/a&gt;&lt;br /&gt;
2. Cool, &lt;img class="jive-emoticon" border="0" src="http://communities.vmware.com/images/emoticons/happy.gif" alt=":)" /&gt;  I've been working on something similar for a project at work (not to mention for my book).&lt;br /&gt;
3. I'm a judge for #1, so I'll refrain from commenting directly on your code in case you decide to submit it, which I suggest you do.&lt;br /&gt;
&lt;br /&gt;
Author of the upcoming book: &lt;a class="jive-link-external" href="http://sapienpress.com/vmware.asp"&gt;Managing VMware Infrastructure with PowerShell&lt;/a&gt;&lt;br /&gt;
Co-Host, PowerScripting Podcast (&lt;a class="jive-link-external" href="http://powerscripting.net"&gt;http://powerscripting.net&lt;/a&gt;)&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;hr /&gt;
Some suggestions:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;configure or check DNS and gateways before steps 3/4/7/8. Critical for clustering, HA and DRS!&lt;/li&gt;
&lt;li&gt;configure the firewall&lt;/li&gt;
&lt;li&gt;(eventually) configure some advanced ESX settings. See for example a recent discussion about NFS.MaxVolumes&lt;/li&gt;
&lt;li&gt;check (and eventually configure) licensing before using clustering with HA/DRS/vMotion&lt;/li&gt;
&lt;li&gt;configure (or adjust) resource pool(s). Adding an ESX server will increase the available resources.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
Very nice, you should definately enter the comp.&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;br /&gt;
Alan Renouf&lt;br /&gt;
VMware, Citrix, Microsoft Consultant&lt;br /&gt;
UK&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;a class="jive-link-external" href="http://teckinfo.blogspot.com/"&gt;My Blog&lt;/a&gt;&lt;br /&gt;
&lt;p /&gt;
&lt;br /&gt;
&lt;hr /&gt;
iberc,&lt;br /&gt;
&lt;br /&gt;
I'm doing a large roll-out of esxi. I have been working on the exact same as what you're doing. If I can add anything across what you got i may post it.&lt;br /&gt;
&lt;br /&gt;
You're scripts look to be more portable. This is my first dive into significant scripting not to mention powershell. The envronment i'm building for is very homogenous so the work reflects it. this is definately work in progress. these files on their own need to be edited etc and linked.&lt;br /&gt;
&lt;p /&gt;
I've been looking for awhile now for configuration of ESXi via powershell and it seems very limited.  Most resources are directed at management of existing.&lt;br /&gt;
&lt;br /&gt;
Message was edited by: olan025&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;hr /&gt;
Lance works for VMware, no $5000 for him, for us 3rd prize is we're fired &lt;img class="jive-emoticon" border="0" src="http://communities.vmware.com/images/emoticons/sad.gif" alt=":(" /&gt;&lt;br /&gt;
&lt;hr /&gt;
My cover has been blown. - l&lt;br /&gt;
&lt;hr /&gt;
Looks great! &lt;br /&gt;
&lt;br /&gt;
Lance, do you know Aiden Dalgleish? He's a PSO Consultant from the UK and already created a hell of a lot scripts for installing. Talk to him, he's got some cool stuff!&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
Duncan&lt;br /&gt;
My virtualisation blog:&lt;br /&gt;
&lt;a class="jive-link-external" href="http://www.yellow-bricks.com"&gt;http://www.yellow-bricks.com&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
If you find this information useful, please award points for "correct" or "helpful".&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;hr /&gt;
Hal,&lt;br /&gt;
&lt;br /&gt;
How about making an exception to allow me a sneak peak at your new book? My scripting needs to be tuned up as you can tell i'm a beginner if you looked at my earlier attachments.&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;br /&gt;
I'm making changes and updates to those, if anyone does care for them post it. otherwise my stuff is pretty basic compared to Lance's functionalized code.&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;br /&gt;
This document was generated from the following thread: &lt;a class="jive-link-thread" href="http://communities.vmware.com/thread/161304"&gt;How To: Configure freshly booted ESX with PowerShell&lt;/a&gt;</description>
      <category domain="http://communities.vmware.com/tags?communityID=2530">automation</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">installation</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">pxe</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">midwife</category>
      <pubDate>Mon, 18 Aug 2008 15:28:14 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-7132</guid>
      <dc:date>2008-08-18T15:28:14Z</dc:date>
      <clearspace:dateToText>10 months, 1 week ago</clearspace:dateToText>
    </item>
    <item>
      <title>How to Move a Template</title>
      <link>http://communities.vmware.com/docs/DOC-7120</link>
      <description>I was surprised this morning to find that you can't directly move templates using the existing cmdlets.  Looks like you can either a) change template to a VM using set-template or b) use Get-View on a Folder object and then call its &lt;a class="jive-link-external" href="http://pubs.vmware.com/vi3/sdk/ReferenceGuide/vim.Folder.html#moveInto"&gt;MoveIntoFolder&lt;/a&gt; method.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Method A&lt;/b&gt; - there and back again&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;$vm = Get-Template wind* | Set-Template -ToVM | 
	Move-VM -Destination (Get-Folder templates) 
$vmView = $vm | Get-View
$vmView.MarkAsTemplate()
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
TotalSeconds      : 8.9222029&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Method B&lt;/b&gt; - do it folder style&lt;br /&gt;
&lt;br /&gt;
This one should be much faster...let's see:&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;$TmplView = Get-Template wind* | Get-View
$FolderView = Get-Folder Templates | Get-View
$FolderView.MoveIntoFolder( $TmplView.MoRef )
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
TotalSeconds      : 2.0466224&lt;br /&gt;
&lt;br /&gt;
We have a winner &lt;img class="jive-emoticon" border="0" src="http://communities.vmware.com/images/emoticons/happy.gif" alt=":)" /&gt;&lt;br /&gt;
&lt;br /&gt;
Note that the timing was performed on my home lab.  I imagine on nice hardware method B would take less than a second.</description>
      <category domain="http://communities.vmware.com/tags?communityID=2530">template</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">performance</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">get-view</category>
      <pubDate>Sun, 17 Aug 2008 16:33:13 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-7120</guid>
      <dc:date>2008-08-17T16:33:13Z</dc:date>
      <clearspace:dateToText>1 year, 3 months ago</clearspace:dateToText>
    </item>
    <item>
      <title>Script: Create Disaster Recovery Hard Drive, with Backup-VM VCB Wrapper CMDLet</title>
      <link>http://communities.vmware.com/docs/DOC-6280</link>
      <description>&lt;h6&gt;Update 27-Aug-08: Script updated for VI Toolkit 1.0 and Powershell v2 CTP2&lt;/h6&gt;
&lt;h1&gt;Create Disaster Recovery Hard Drive&lt;/h1&gt;
&lt;h2&gt;Motivation &lt;/h2&gt;
This script was created out of a motivation of laziness. Since VM's proliferate so fast, most backup and disaster recovery solutions are a pain in the ass because you have to manually add and remove virtual machines to their backup processes. What if there was a way to automatically add and remove VM's to a backup solution simply because of where they are located in Virtualcenter? What if I had an automated DR solution to removable USB hard drives for my smaller clients that was FREE? &lt;br /&gt;
&lt;br /&gt;
Hence this script. This script dynamically backs up all VM's in a particular Virtualcenter folder using VCB, and drops them out to a USB hard drive for disaster recovery purposes. If I don't want a VM backed up anymore, I simply take it out of that folder. &lt;br /&gt;
&lt;br /&gt;
Note that this also leverages the new networked method of VCB, so &lt;b&gt;YOU DO NOT NEED A SAN AND DIRECT ACCESS TO THE LUNs.&lt;/b&gt; &lt;br /&gt;
&lt;br /&gt;
The script is also flexible enough so that if you do have the SAN VCB configuration, you can do LAN-free backups with this method too. &lt;br /&gt;
&lt;br /&gt;
Note that the query here is just an example. Any way you can return a list of VM's, you can give it to the backup-vm cmdlet. &lt;br /&gt;
&lt;br /&gt;
Some examples that come to mind: &lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Backup all virtual machines with disks under 500MB in size&lt;/li&gt;
&lt;li&gt;Backup all virtual machines created after July 1st&lt;/li&gt;
&lt;li&gt;Backup all virtual machines with "Prod" in their names&lt;/li&gt;
&lt;li&gt;Backup all virtual machines with a custom attribute defined called "BackMeUp" set to true&lt;/li&gt;
&lt;li&gt;Backup all virtual machines currently residing on a particular host, cluster, or datacenter.&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
This script took me about 8 hours, mostly because I was learning how to do script cmdlets and dealing with all the incompatabilities/breakage of CTP Powershell releases as well. &lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Script Cmdlets&lt;/h2&gt;
The task evolved into my first foray into the new Script Cmdlets in Powershell v2. They're so easy to make I went wild and wrote a near-complete wrapper to VCB. Cut and paste the "cmdlet" section out of the code and put it in your profile, and you can now use the Backup-VM cmdlet. &lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Usage&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Install onto a server or workstation with the prerequisites defined in the script (VCB, Powershell v2 CTP2, VI Toolkit v1.0)&lt;/li&gt;
&lt;li&gt;Edit the parameters of the script to suit your environment. &lt;b&gt;BE VERY CAREFUL WITH VMBackupDestination&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Run to test, then set up as a scheduled task on a daily interval.&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
Example Screenshot:&lt;br /&gt;
&lt;a class="jive-link-external" href="http://i36.tinypic.com/5zeel1.png"&gt;VCB Backup Script in Action&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Script&lt;/h2&gt;
Due to issues with VMWare Communities, the script is now attached to this document.</description>
      <pubDate>Mon, 14 Jul 2008 14:47:56 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-6280</guid>
      <dc:date>2008-07-14T14:47:56Z</dc:date>
      <clearspace:dateToText>1 year, 3 months ago</clearspace:dateToText>
      <clearspace:replyCount>2</clearspace:replyCount>
    </item>
    <item>
      <title>Script: VMWare Lab Manager Automatic Cleanup</title>
      <link>http://communities.vmware.com/docs/DOC-6125</link>
      <description>&lt;h2&gt;Motivation &lt;/h2&gt;
In the official documentation they say that you shouldn't use Lab Manager and Virtualcenter to manage the same ESX Hosts. Since I don't have the luxury of investing in dedicated ESX Servers for my lab, I decided to write a script that automatically moves Lab Manager-created VM's into a specific folder and resource pool, and automatically removes undeployed Lab Manager VM's from the inventory. &lt;br /&gt;
&lt;br /&gt;
This keeps my VirtualCenter organized and puts the Lab Machines in low-end resource pools so that my production VM's still get their reserves and SLA shares. &lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Requirements&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Powershell&lt;/li&gt;
&lt;li&gt;VI Toolkit for Windows&lt;/li&gt;
&lt;li&gt;A VirtualCenter user with rights to browse through VirtualCenter and Move VM's&lt;/li&gt;
&lt;li&gt;Access to the SSL port of your Virtualcenter server from the host you run the script (i.e. not firewalled).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Usage&lt;/h2&gt;
First, edit the script and change the constants so that they match your environment:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;&lt;b&gt;Lab Manager Resource Pool&lt;/b&gt; - Which resource pool you want your Lab Manager VMs to reside (ex. "MyLab")&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Lab Manager Folder&lt;/b&gt; - Same as above but a folder under Virtual Machines and Templates&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Virtualcenter Server&lt;/b&gt; - Your VC Server. Note that the name here must match the name on your virtualcenter SSL certificate.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;VC Username&lt;/b&gt; - The user to connect to VirtualCenter as. I recommend a service account but you can use "administrator" if you want.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;VC Password&lt;/b&gt; - Password for the user. Yes, I know it is in cleartext in the script, but since it's on my VC server using a low-privilege service account and I apply strict permissions to the files there, I'm not worried. If this bothers you, look up the SecureCredentials stuff in powershell.&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
I set up this to run as a scheduled task on my VirtualCenter server every 5 minutes, but it can run anywhere that has the VI Toolkit and access to the VirtualCenter SSL port.&lt;br /&gt;
&lt;br /&gt;
I recommend creating a service account to run the script periodically under, because it looks cool in your Virtualcenter when a bunch of cleanup tasks owned by "LabManagerCleanup" come up every 5 minutes. &lt;br /&gt;
&lt;br /&gt;
Huge thanks to the VI Toolkit team! The meat of the script is probably only about 10-15 lines and makes some direct VMWare SDK accesses that the base cmdlets don't do, I've just added a ton of comments and colored output fluff. Powershell saved me &lt;b&gt;so&lt;/b&gt; much time, I banged this out in a couple hours.&lt;br /&gt;
&lt;p /&gt;
Hope this helps anyone else out there! I know there's some kludgy logic in this script and I note it, but I'm a consultant/admin, not a programmer, and it works just fine. Feel free to make it better!&lt;br /&gt;
&lt;p /&gt;
&lt;b&gt;NOTE: The below may not format well in some versions of IE7. View it in Firefox and it should be line-carriaged properly.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-java"&gt;# TITLE: 	Lab Manager Cleanup Script
# AUTHOR:	Justin Grote &amp;lt;jgrote*NO*@!SPAM!enpointe.|PLEASE|com&amp;gt;
# PURPOSE:	Cleans up undeployed Lab Manager VM&lt;font color="navy"&gt;'s, and puts deployed Lab Manager VM'&lt;/font&gt;s 
# 			into specific resource pools and folders
# USAGE:	Edit Constants to match your environment, run once manually to test, then schedule as repeating task.
 
#Load the VI Toolkit &lt;font color="navy"&gt;&lt;b&gt;for&lt;/b&gt;&lt;/font&gt; Powershell
add-pssnapin VMWare.VimAutomation.Core
 
## CONSTANTS
 
#Virtualcenter Server Name
$VCNAME = &lt;font color="red"&gt;&amp;quot;virtualcenter.yourcompany.com&amp;quot;&lt;/font&gt;
 
#VirtualCenter Service Account
#NOTE: Highly recommended &lt;font color="navy"&gt;&lt;b&gt;this&lt;/b&gt;&lt;/font&gt; be a separate service account such as &lt;font color="red"&gt;&amp;quot;VMLabMgrSA&amp;quot;&lt;/font&gt; so it is easy
#      to see in Virtualcenter when the script is moving things about.
$VCUSER = &lt;font color="red"&gt;&amp;quot;username&amp;quot;&lt;/font&gt;
$VCPASSWORD = &lt;font color="red"&gt;&amp;quot;yourpassword&amp;quot;&lt;/font&gt;
 
#Desired Lab Resource Pool Name
$LABMGRPOOLNAME = &lt;font color="red"&gt;&amp;quot;MyLabManagerResourcePool&amp;quot;&lt;/font&gt;
 
#Desired Virtualcenter Folder
$LABMGRFOLDERNAME = &lt;font color="red"&gt;&amp;quot;MyLabManagerFolder&amp;quot;&lt;/font&gt;
 
#Creates an indentation &lt;font color="navy"&gt;&lt;b&gt;for&lt;/b&gt;&lt;/font&gt; subtasks. Used &lt;font color="navy"&gt;&lt;b&gt;for&lt;/b&gt;&lt;/font&gt; script output formatting
$INDENT = &lt;font color="red"&gt;&amp;quot;  &amp;quot;&lt;/font&gt;
 
### SCRIPT
write-host -fore green &lt;font color="red"&gt;&amp;quot;== BEGIN LAB MANAGER CLEANUP ==&amp;quot;&lt;/font&gt;
 
#Connect to Virtualcenter
$vc = get-viserver $VCNAME -user $VCUSER -password $VCPASSWORD
 
#Lab Manager Resource Pool
$LabMgrPool = get-resourcepool $LABMGRPOOLNAME
 
#Lab Manager Virtualcenter Folder
$LabMgrFolder = get-folder $LABMGRFOLDERNAME
 
#Discover all Lab Manager VM&lt;font color="navy"&gt;'s. &lt;/font&gt;
#Note &lt;font color="navy"&gt;&lt;b&gt;this&lt;/b&gt;&lt;/font&gt; is done really sloppily by looking &lt;font color="navy"&gt;&lt;b&gt;for&lt;/b&gt;&lt;/font&gt; all VM&lt;font color="navy"&gt;'s that have a .vmx file in a &lt;/font&gt;
#specific datastore folder that Lab Manager manages. 
#A Better way would be to query some sort of Lab Manager API.
$LabMgrVMs = get-vm | where &lt;font color="navy"&gt;{&lt;/font&gt;(get-view $_.ID).summary.config.vmpathname -like &lt;font color="red"&gt;&amp;quot;*] VM/*&amp;quot;&lt;/font&gt;&lt;font color="navy"&gt;}&lt;/font&gt;
 
 
## TASK 1: Move All Virtual Machines to the designated Lab Manager Folder and Resource Pool
 
write-host -fore green &lt;font color="red"&gt;&amp;quot;Moving Lab Manager Virtual Machines to their desired locations...&amp;quot;&lt;/font&gt;
foreach ($LabMgrVM in $LabMgrVMs) &lt;font color="navy"&gt;{&lt;/font&gt;
 
  #Verify that the VM is not already in the desired folder and move it.
  &lt;font color="navy"&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt; (-not ($(get-vm -location $LabMgrFolder | foreach&lt;font color="navy"&gt;{&lt;/font&gt;$_.get_ID() &lt;font color="navy"&gt;}&lt;/font&gt;) -contains $LabMgrVM.get_ID() )) &lt;font color="navy"&gt;{&lt;/font&gt;
    write-host -fore Yellow $INDENT &lt;font color="red"&gt;&amp;quot;Moving&amp;quot;&lt;/font&gt; $LabMgrVM.Name &lt;font color="red"&gt;&amp;quot;to folder&amp;quot;&lt;/font&gt; $LabMgrFolder.Name
    move-VM $LabMgrVM -Location $LabMgrFolder | out-&lt;font color="navy"&gt;&lt;b&gt;null&lt;/b&gt;&lt;/font&gt;
  &lt;font color="navy"&gt;}&lt;/font&gt;
  &lt;font color="navy"&gt;&lt;b&gt;else&lt;/b&gt;&lt;/font&gt; &lt;font color="navy"&gt;{&lt;/font&gt;
    write-host $INDENT $LabMgrVM.Name &lt;font color="red"&gt;&amp;quot;is already in folder&amp;quot;&lt;/font&gt; $LabMgrFolder.Name
  &lt;font color="navy"&gt;}&lt;/font&gt;
 
  #Verify that the VM is not already in the desired resource pool and move it.
  &lt;font color="navy"&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt; (-not ($(get-vm -location $LabMgrPool | foreach&lt;font color="navy"&gt;{&lt;/font&gt;$_.get_ID() &lt;font color="navy"&gt;}&lt;/font&gt;) -contains $LabMgrVM.get_ID() )) &lt;font color="navy"&gt;{&lt;/font&gt;
    write-host -fore Yellow $INDENT &lt;font color="red"&gt;&amp;quot;Moving&amp;quot;&lt;/font&gt; $LabMgrVM.Name &lt;font color="red"&gt;&amp;quot;to resource pool&amp;quot;&lt;/font&gt; $LabMgrPool.Name
    move-VM $LabMgrVM -Location $LabMgrPool | out-&lt;font color="navy"&gt;&lt;b&gt;null&lt;/b&gt;&lt;/font&gt;
  &lt;font color="navy"&gt;}&lt;/font&gt;
  &lt;font color="navy"&gt;&lt;b&gt;else&lt;/b&gt;&lt;/font&gt; &lt;font color="navy"&gt;{&lt;/font&gt;
    write-host $INDENT $LabMgrVM.Name &lt;font color="red"&gt;&amp;quot;is already in resource pool&amp;quot;&lt;/font&gt; $LabMgrPool.Name
  &lt;font color="navy"&gt;}&lt;/font&gt;
&lt;font color="navy"&gt;}&lt;/font&gt;
 
 
## TASK 2: Clean up all undeployed Lab Manager VMs.
 
write-host -fore green &lt;font color="red"&gt;&amp;quot;Cleaning up all undeployed Lab Manager VMs&amp;quot;&lt;/font&gt;
 
#Get all Lab Manager VM&lt;font color="navy"&gt;'s listed in the defined Lab Manager folder.&lt;/font&gt;
#I &lt;font color="navy"&gt;&lt;b&gt;do&lt;/b&gt;&lt;/font&gt; &lt;font color="navy"&gt;&lt;b&gt;this&lt;/b&gt;&lt;/font&gt; instead of getting *ALL* VM&lt;font color="navy"&gt;'s because there may be some orphaned VMs that&lt;/font&gt;
#Aren&lt;font color="navy"&gt;'t from Lab Manager that we may not want to touch&lt;/font&gt;
#Again, &lt;font color="navy"&gt;&lt;b&gt;this&lt;/b&gt;&lt;/font&gt; is sloppy, and should use some sort of Lab Manager API
$LabMgrRegisteredVMs = get-vm -location $LabMgrFolder
 
#Check &lt;font color="navy"&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt; any Lab Manager VM&lt;font color="navy"&gt;'s are orphaned, and remove them from the inventory.&lt;/font&gt;
foreach ($LabMgrVM in $LabMgrRegisteredVMs) &lt;font color="navy"&gt;{&lt;/font&gt;
  &lt;font color="navy"&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt; ((get-view $LabMgrVM.get_ID() ).runtime.ConnectionState -like &lt;font color="red"&gt;&amp;quot;orphaned&amp;quot;&lt;/font&gt;) &lt;font color="navy"&gt;{&lt;/font&gt;
    write-host $INDENT &lt;font color="red"&gt;&amp;quot;Removing orphaned VM&amp;quot;&lt;/font&gt; $LabMgrVM.Name &lt;font color="red"&gt;&amp;quot;from inventory.&amp;quot;&lt;/font&gt;
    remove-VM $LabMgrVM -confirm:$false | out-&lt;font color="navy"&gt;&lt;b&gt;null&lt;/b&gt;&lt;/font&gt;
  &lt;font color="navy"&gt;}&lt;/font&gt;
&lt;font color="navy"&gt;}&lt;/font&gt;
 
write-host -fore green &lt;font color="red"&gt;&amp;quot;== END LAB MANAGER CLEANUP ==&amp;quot;&lt;/font&gt;
### END SCRIPT
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;br /&gt;
&lt;hr /&gt;
Justin Grote&lt;br /&gt;
Senior Systems Engineer&lt;br /&gt;
En Pointe Technologies</description>
      <category domain="http://communities.vmware.com/tags?communityID=2530">automation</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">lab</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">manager</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">vmware</category>
      <pubDate>Mon, 30 Jun 2008 01:15:55 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-6125</guid>
      <dc:date>2008-06-30T01:15:55Z</dc:date>
      <clearspace:dateToText>1 year, 4 months ago</clearspace:dateToText>
      <clearspace:replyCount>4</clearspace:replyCount>
    </item>
    <item>
      <title>Get-CustomField.ps1 Script</title>
      <link>http://communities.vmware.com/docs/DOC-6123</link>
      <description>&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;# TITLE: 	Get-CustomField.ps1
# AUTHOR:	Hal Rottenberg &amp;lt;hal@halr9000.com&amp;gt;
# PURPOSE:	Retrieve custom field data from any VMware Infrastructure &amp;quot;managed entity&amp;quot; 
# 			(i.e. VM, VMHost, Cluster, etc.).
# USAGE:	Use a Get cmdlet such as Get-VM or Get-Inventory and pipe to this script.
#			Optionally, specify the Name parameter to modify items retrieved.  Wildcards
#			are permitted.
# INPUT:	By pipeline only, any managed entity.
# OUTPUT:	A custom object containing the fields Name, Value, InputObject, and Type
# EXAMPLE:	
# PS&amp;gt; Get-Inventory | Get-CustomField.PS1 -name Service*
# 
# Name                    Value                  InputObject            Type
# ----                    -----                  -----------            ----
# ServiceLevel            Gold                   192.168.0.51           VMHostImpl

param (
	$Include # Search by this custom field name (aka key)
)
Process {
	# If the object on the pipeline does not have a CustomFields property, ignore it
	if ( !$_.CustomFields ) { continue }
	# Save this for later inclusion into the output custom object.
	$InputObject =  $_
	# An entity can be one of several types, it may be useful to know which one.
	$Type = $InputObject.GetType().Name
	$_.CustomFields | ForEach-Object {
		# If Name was provided, filter out the non-matches
		if ( ( $Name -and ( $_.Key -like $Name )) -or !$Name ) {
			# Build custom object to hold output.
			$Process = New-Object PSObject
			$Process | Add-Member -MemberType NoteProperty -Name Name -Value $_.Key -PassThru |
				Add-Member -MemberType NoteProperty -Name Value $_.Value -PassThru |
				Add-Member -MemberType NoteProperty -Name InputObject -Value $InputObject -PassThru |
				Add-Member -MemberType NoteProperty -Name Type -Value $Type
			Write-Output $Process
		}
	}
}
&lt;/code&gt;&lt;/pre&gt;</description>
      <category domain="http://communities.vmware.com/tags?communityID=2530">customfield</category>
      <pubDate>Sun, 29 Jun 2008 21:15:50 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-6123</guid>
      <dc:date>2008-06-29T21:15:50Z</dc:date>
      <clearspace:dateToText>1 year, 4 months ago</clearspace:dateToText>
      <clearspace:replyCount>1</clearspace:replyCount>
    </item>
    <item>
      <title>VI Toolkit (for Windows) (Very) Unofficial Extensions</title>
      <link>http://communities.vmware.com/docs/DOC-6051</link>
      <description />
      <category domain="http://communities.vmware.com/tags?communityID=2530">cmdlet</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">automation</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">vmware</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">module</category>
      <pubDate>Mon, 23 Jun 2008 20:13:26 GMT</pubDate>
      <author>cshanklin@vmware.com</author>
      <guid>http://communities.vmware.com/docs/DOC-6051</guid>
      <dc:date>2008-06-23T20:13:26Z</dc:date>
      <clearspace:dateToText>1 year, 2 months ago</clearspace:dateToText>
      <clearspace:replyCount>4</clearspace:replyCount>
    </item>
    <item>
      <title>Specify the boot devices for a virtual machine</title>
      <link>http://communities.vmware.com/docs/DOC-4782</link>
      <description>The below Powershell script is (heavily) based on &lt;a class="jive-link-external" href="http://download3.vmware.com/sample_code/Perl/VMBootOrder.html"&gt;this Perl script&lt;/a&gt;.&lt;br /&gt;
It uses a feature that is available with &lt;b&gt;VC2.5&lt;/b&gt; or later and &lt;b&gt;ESX 3.5&lt;/b&gt; or later.&lt;br /&gt;
&lt;br /&gt;
The keyword "&lt;b&gt;bios.bootDeviceClasses&lt;/b&gt;" allows to define the boot devices in the VMX file.&lt;br /&gt;
&lt;p /&gt;
&lt;span style="color:#ff0000"&gt;Note&lt;/span&gt;: this does not allow one to change the boot order !&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
For more info on the syntax see the Perl script.&lt;br /&gt;
&lt;br /&gt;
The following example sets the boot devices of the virtual machine to the CD drive and the hard disk.&lt;br /&gt;
&lt;p /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-java"&gt;
$spec = New-Object VMware.Vim.VirtualMachineConfigSpec
$spec.extraConfig += New-Object VMware.Vim.OptionValue
$spec.extraConfig[0].key = &lt;font color="red"&gt;&amp;quot;bios.bootDeviceClasses&amp;quot;&lt;/font&gt;
$spec.extraConfig[0].value = &lt;font color="red"&gt;&amp;quot;allow:cd,hd&amp;quot;&lt;/font&gt;
 
(get-view (Get-VM -Name &amp;lt;VM-name&amp;gt;).ID).ReconfigVM_Task($spec)
&amp;nbsp;
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
If you want to force a boot from CD, for example for an OS deployment, only allow the CD device.&lt;br /&gt;
Once the OS installation is complete change the allowed boot devices to only the hard disk.</description>
      <pubDate>Thu, 24 Apr 2008 18:19:00 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-4782</guid>
      <dc:date>2008-04-24T18:19:00Z</dc:date>
      <clearspace:dateToText>1 year, 5 months ago</clearspace:dateToText>
      <clearspace:replyCount>2</clearspace:replyCount>
    </item>
    <item>
      <title>Managing VMware with PowerShell FAQ</title>
      <link>http://communities.vmware.com/docs/DOC-4210</link>
      <description>&lt;h1&gt;Managing VMware with PowerShell -- Frequently Asked Questions&lt;/h1&gt;
This document contains frequently asked questions about managing VMware with PowerShell. This document is a wiki page, so if you have contributions or corrections, feel free to make them by editing the document directly.&lt;br /&gt;
&lt;br /&gt;
Note: If you are using Internet Explorer, the code samples below do not render properly. To deal with this problem you can click "Edit Document" on the left hand side of the page, switch to plain text view, and copy text out of the document.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;General VI Toolkit (for Windows) Questions:&lt;/h2&gt;
Q: What is the VI Toolkit (for Windows)?&lt;br /&gt;
A: The VI Toolkit (for Windows) is a snap-in to Windows PowerShell that provides administration and automation for VMware Virtual Infrastructure.&lt;br /&gt;
&lt;br /&gt;
Q: Does this FAQ cover a particular version of the VI Toolkit (for Windows)?&lt;br /&gt;
A: Yes, this FAQ specifically covers the VI Toolkit (for Windows) 1.0, build 103777.&lt;br /&gt;
&lt;br /&gt;
Q: What VMware versions are supported?&lt;br /&gt;
A: Version 1.0 supports: VMware ESX 3.0.x, VMware ESX 3.5, VMware ESXi 3.5, VMware VirtualCenter 2.0 and VMware VirtualCenter 2.5. In addition, with the VI Toolkit (for Windows) you can manage multiple hosts at the same time, even if they are different versions of VI.&lt;br /&gt;
&lt;br /&gt;
Q: What client platforms does the VI Toolkit (for Windows) support?&lt;br /&gt;
A: Windows XP, 2003 and Vista, 32 and 64 bit versions.&lt;br /&gt;
&lt;br /&gt;
Q: What versions of PowerShell are compatible with the VI Toolkit (for Windows)?&lt;br /&gt;
A: The toolkit has been tested with PowerShell version 1, as well as the Community Technology Preview releases of PowerShell version 2.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;General PowerShell Questions:&lt;/h2&gt;
Q: How do I stop PowerShell from prompting me for confirmation before taking action?&lt;br /&gt;
A: Using parameter -Confirm one can bypass the confirmation messagebox. This parameter takes input as a Boolean. &lt;br /&gt;
Use &lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-java"&gt;-Confirm:$false
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
Q: Can I manage more than one VirtualCenter server at a time? Can I connect to both ESX and VC at the same time.&lt;br /&gt;
A: Yes, but the syntax changes when you want to manage more than one host.&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-java"&gt;$vcs = @()
$vcs += connect-viserver &amp;lt;VC 1&amp;gt;
$vcs += connect-viserver &amp;lt;VC 2&amp;gt;
...
$vcs += connect-viserver &amp;lt;VC N&amp;gt;
 
# Snapshot all VMs across all VirtualCenter servers.
get-vm -server $vcs | new-snapshot
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
&lt;h2&gt;Initial Steps&lt;/h2&gt;
Q: How do I connect to a VirtualCenter Server or Host Server?&lt;br /&gt;
A: Use the Connect-VIServer cmdlet and provide a value to the Server parameter.&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-java"&gt;connect-viserver -server &amp;lt;server&amp;gt; -user &amp;lt;user&amp;gt; -password &amp;lt;pwd&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
Q: What if my host server listens on a non-default port?&lt;br /&gt;
A: Use the Port parameter to specify the port number.&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-java"&gt;connect-viserver -server &amp;lt;server&amp;gt; -user &amp;lt;user&amp;gt; -password &amp;lt;pwd&amp;gt; -port &amp;lt;port&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
&lt;h2&gt;VM Lifecycle:&lt;/h2&gt;
Q: How do I create a VM?&lt;br /&gt;
A: New virtual machine can be created using New-VM cmdlet. Before, executing this cmdlet first you need to connect to server. Below script would create a new virtual machine in the same host. &lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-java"&gt;New-VM -Name &lt;font color="red"&gt;&amp;quot;Target-VM&amp;quot;&lt;/font&gt; -Host (Get-VMHost) 
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
Q: How do I create a VM on a particular datastore?&lt;br /&gt;
A: To create a virtual machine on a particular we need the reference of the datastore. This script creates a new virtual machine on a particular datastore.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-java"&gt;connect-viserver -server &amp;lt;server&amp;gt; -user &amp;lt;user&amp;gt; -password &amp;lt;pwd&amp;gt;
$datastore = Get-Datastore -Name &lt;font color="red"&gt;&amp;quot;Select-Datastore-Name&amp;quot;&lt;/font&gt;
New-VM -Name &lt;font color="red"&gt;&amp;quot;Target-VM&amp;quot;&lt;/font&gt; -Host (Get-VMHost -Datastore $datastore) 
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
Q: How can I import an existing VM?&lt;br /&gt;
A: This script will import a VM to the vm folder.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-java"&gt;connect-viserver -server &amp;lt;server&amp;gt; -user &amp;lt;user&amp;gt; -password &amp;lt;pwd&amp;gt;
&amp;nbsp;
# If importing to a cluster uncomment the line below
# $rp = get-cluster &amp;lt;cluster name&amp;gt; | get-resourcepool | get-view
&amp;nbsp;
# If importing to a non-cluster host uncomment the line below
# $rp = get-vmhost &amp;lt;host name&amp;gt; | get-resourcepool | get-view
&amp;nbsp;
$vmFolder = get-view (get-folder vm).id
$vmFolder.RegisterVM_Task(&lt;font color="red"&gt;&amp;quot;[&amp;lt;Datastore Name&amp;gt;] &amp;lt;Path To VMX&amp;gt;.vmx&amp;quot;&lt;/font&gt;, &lt;font color="red"&gt;&amp;quot;&amp;lt;VM Name&amp;gt;&amp;quot;&lt;/font&gt;, $false, $rp.MoRef, $null)
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
Q: How can I determine the connection state of CD ROM drives and floppy drives?&lt;br /&gt;
A: Connection state of CD drive and Floppy drive can be determined by property &amp;ldquo;Connected:. This return Boolean value true for connected and false for disconnected state. Below script would determine the connection state of CD and floppy drive.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-java"&gt;connect-viserver -server &amp;lt;server&amp;gt; -user &amp;lt;user&amp;gt; -password &amp;lt;pwd&amp;gt;
Write-Output &lt;font color="red"&gt;&amp;quot;FloppyDrive Status:&amp;quot;&lt;/font&gt;
Get-vm | Select-Object @&lt;font color="navy"&gt;{&lt;/font&gt; Name=&lt;font color="red"&gt;&amp;quot;Status&amp;quot;&lt;/font&gt;; Expression=&lt;font color="navy"&gt;{&lt;/font&gt;(Get-FloppyDrive -VM $_).ConnectionState.Connected&lt;font color="navy"&gt;}&lt;/font&gt;&lt;font color="navy"&gt;}&lt;/font&gt;, @&lt;font color="navy"&gt;{&lt;/font&gt; Name=&lt;font color="red"&gt;&amp;quot;Name&amp;quot;&lt;/font&gt;; Expression=&lt;font color="navy"&gt;{&lt;/font&gt;$_.Name&lt;font color="navy"&gt;}&lt;/font&gt;&lt;font color="navy"&gt;}&lt;/font&gt; | ft
Write-Output &lt;font color="red"&gt;&amp;quot;CDDrive Status:&amp;quot;&lt;/font&gt;
Get-vm | Select-Object @&lt;font color="navy"&gt;{&lt;/font&gt; Name=&lt;font color="red"&gt;&amp;quot;Status&amp;quot;&lt;/font&gt;; Expression=&lt;font color="navy"&gt;{&lt;/font&gt;(Get-CDDrive -VM $_).ConnectionState.Connected&lt;font color="navy"&gt;}&lt;/font&gt;&lt;font color="navy"&gt;}&lt;/font&gt;, @&lt;font color="navy"&gt;{&lt;/font&gt; Name=&lt;font color="red"&gt;&amp;quot;Name&amp;quot;&lt;/font&gt;; Expression=&lt;font color="navy"&gt;{&lt;/font&gt;$_.Name&lt;font color="navy"&gt;}&lt;/font&gt;&lt;font color="navy"&gt;}&lt;/font&gt; | ft
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
Q: How can I set VM poweron options, such as configuring tools to automatically upgrade?&lt;br /&gt;
A: By setting the ToolsUpgradePolicy property to upgradeAtPowerCycle. With this setting Tools upgrade is automatically performed on the virtual machine and rebooted if necessary. Below is the script for the same.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-java"&gt;connect-viserver -server &amp;lt;server&amp;gt; -user &amp;lt;user&amp;gt; -password &amp;lt;pwd&amp;gt;
$vm = Get-View (Get-VM VMName).Id
$vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
$vmConfigSpec.Tools = New-Object VMware.Vim.ToolsConfigInfo 
$vmConfigSpec.Tools.ToolsUpgradePolicy = &lt;font color="red"&gt;&amp;quot;UpgradeAtPowerCycle&amp;quot;&lt;/font&gt;
$vm.ReconfigVM($vmConfigSpec)
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
Q: How do I set resources, such as limits and reservations, on a VM?&lt;br /&gt;
A: Various resources of a virtual machine can be set using the ReconfigVM_task method on virtual machine. To setting the reservation and limits of a virtual machine an instance of VirtualMachienConfigSpec would be created and all the required resources can be set in configspec befre calling the ReconfigVM_Task. Below is the script for the same.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-java"&gt;connect-viserver -Server &amp;lt;Server&amp;gt; -User &amp;lt;user&amp;gt; -Password &amp;lt;password&amp;gt;
$vm = Get-VM VMName | % &lt;font color="navy"&gt;{&lt;/font&gt;Get-View $_.ID&lt;font color="navy"&gt;}&lt;/font&gt; 
$spec = new-object VMware.Vim.VirtualMachineConfigSpec
$spec.CPUAllocation = New-Object VMware.Vim.ResourceAllocationInfo
$spec.CpuAllocation.Shares = New-Object VMware.Vim.SharesInfo 
$spec.CpuAllocation.Shares.Level = &lt;font color="red"&gt;&amp;quot;normal&amp;quot;&lt;/font&gt;
$spec.CpuAllocation.Limit = -1
$vm.ReconfigVM_Task($spec)
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
Q: How can I determine the version of VMware tools my VMs are using?&lt;br /&gt;
A: Toolversion property under the config property of virtual machine object having this information. To get this information we can use the below script.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-java"&gt;connect-viserver -Server &amp;lt;Server&amp;gt; -User &amp;lt;user&amp;gt; -Password &amp;lt;password&amp;gt;
get-vm VMName | % &lt;font color="navy"&gt;{&lt;/font&gt; get-view $_.ID &lt;font color="navy"&gt;}&lt;/font&gt; | select Name, @&lt;font color="navy"&gt;{&lt;/font&gt; Name=&lt;font color="red"&gt;&amp;quot;ToolsVersion&amp;quot;&lt;/font&gt;; Expression=&lt;font color="navy"&gt;{&lt;/font&gt;$_.config.tools.toolsVersion&lt;font color="navy"&gt;}&lt;/font&gt;&lt;font color="navy"&gt;}&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
Q: How can I change a VM's IP address?&lt;br /&gt;
A: This script can be used to change the IP setting.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-java"&gt;connect-viserver -server &amp;lt;server&amp;gt; -user &amp;lt;user&amp;gt; -password &amp;lt;pwd&amp;gt;
 
$vmclonespec = New-Object VMware.Vim.VirtualMachineCloneSpec
$vmclonespec.Customization = New-Object  VMware.Vim.CustomizationSpec
$vmclonespec.Customization.NicSettingMap = @(New-Object VMware.Vim.CustomizationAdapterMapping)
$vmclonespec.Customization.NicSettingMap[0].Adapter = New-Object VMware.Vim.CustomizationIPSettings
$vmclonespec.Customization.NicSettingMap[0].Adapter.ip = New-Object VMware.Vim.CustomizationFixedIp
$vmclonespec.Customization.NicSettingMap[0].Adapter.Ip.IpAddress = &lt;font color="red"&gt;&amp;quot;&amp;lt;Target IP Address&amp;gt;&amp;quot;&lt;/font&gt;
$vmclonespec.Customization.Identity = New-Object vmware.Vim.CustomizationIdentitySettings
$vmclonespec.Customization.GlobalIPSettings = New-Object VMware.Vim.CustomizationGlobalIPSettings
 
$vmclonespec.config = New-Object VMware.Vim.VirtualMachineConfigSpec
$vmclonespec.location = New-Object VMware.Vim.VirtualMachineRelocateSpec
 
$vmclonespec.powerOn = $false
$vmclonespec.template = $false
$name = &lt;font color="red"&gt;&amp;quot;Test&amp;quot;&lt;/font&gt;
 
$target = Get-Folder -Name TARGETFOLDER | % &lt;font color="navy"&gt;{&lt;/font&gt;Get-View $_.ID&lt;font color="navy"&gt;}&lt;/font&gt;  
$vmmor = Get-VM VMNAME | Get-View
$vmmor.CloneVM_Task($target.MoRef ,$name, $vmclonespec )
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
Q: How do I VMotion a VM?&lt;br /&gt;
A: This script can be used to VMotion from ESSX1 to ESX2.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-java"&gt;connect-viserver -Server &amp;lt;Server&amp;gt; -User &amp;lt;user&amp;gt; -Password &amp;lt;password&amp;gt;
get-vmhost ESX1 | get-vm namevm | move-vm &amp;amp;amp;ndash;destination (get-vmhost ESX2)
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
&lt;h2&gt;Snapshots:&lt;/h2&gt;
Q: How do I snapshot a VM? Multiple VMs?&lt;br /&gt;
A: New-Snapshot cmdlet can be used to create the snapshot of a virtual machine. This script will create the snapshot with name &amp;ldquo;Target-Snpsht&amp;rdquo; for all the virtual machines.&lt;br /&gt;
To do snapshot of a particular machine use Get-VM with virtual machine. Below is the script for the same.&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-java"&gt;connect-viserver -server &amp;lt;server&amp;gt; -user &amp;lt;user&amp;gt; -password &amp;lt;pwd&amp;gt;
New-Snapshot -Name &amp;amp;amp;ldquo;Target-Snpsht&amp;amp;amp;rdquo; -VM (Get-VM)
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
Q: How do I set a VM to a particular snapshot?&lt;br /&gt;
A: A virtual machine can have multiple snapshots and any of them can be set at a time. This script can set a virtual machine to a specified snapshot.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-java"&gt;connect-viserver -server &amp;lt;server&amp;gt; -user &amp;lt;user&amp;gt; -password &amp;lt;pwd&amp;gt;
$vm = Get-VM -Name &amp;amp;amp;ldquo;VMName&amp;amp;amp;rdquo;
$snapshotname = $vm | Get-Snapshot -Name &amp;amp;amp;ldquo;Target-Snpsht&amp;amp;amp;rdquo;  
$vm | get-snapshot -Name &amp;amp;amp;ldquo;Target-Snpsht&amp;amp;amp;rdquo; | where &lt;font color="navy"&gt;{&lt;/font&gt; $_.name -like $snapshotname.name &lt;font color="navy"&gt;}&lt;/font&gt;  | %&lt;font color="navy"&gt;{&lt;/font&gt; set-vm $vm -snapshot $snapshotname &lt;font color="navy"&gt;}&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
Q: How can I identify all snapshots older than a particular date?&lt;br /&gt;
A: This script show snapshots more than 30 days old.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-java"&gt;connect-viserver -server &amp;lt;server&amp;gt; -user &amp;lt;user&amp;gt; -password &amp;lt;pwd&amp;gt;
Get-VM | Get-Snapshot | Where &lt;font color="navy"&gt;{&lt;/font&gt; $_.Created -lt (Get-Date).AddDays(-30)&lt;font color="navy"&gt;}&lt;/font&gt; | select Name, Created
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
&lt;h2&gt;ESX Host Configuration:&lt;/h2&gt;
Q: How can I create virtual switches and portgroups?&lt;br /&gt;
A: This script creates the virtual switches. &lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-java"&gt;connect-viserver -server &amp;lt;server&amp;gt; -user &amp;lt;user&amp;gt; -password &amp;lt;pwd&amp;gt;
 
Get-VMHost YOURHOST | New-VirtualSwitch -name &lt;font color="red"&gt;&amp;quot;My New Switch&amp;quot;&lt;/font&gt; -nic YOURNIC (e.g. vmnic1)
Get-VMHost YOURHOST | Get-VirtualSwitch -name &lt;font color="red"&gt;&amp;quot;My New Switch&amp;quot;&lt;/font&gt; | New-VirtualPortGroup -vlanid 100
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
Q: How can I configure NTP?&lt;br /&gt;
A: This script can be used to configure the NTP.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-java"&gt;connect-viserver -server &amp;lt;server&amp;gt; -user &amp;lt;user&amp;gt; -password &amp;lt;pwd&amp;gt;
$HS = Get-VMHost YOURHOST | get-view
$dtsystem =  $HS.ConfigManager.DateTimeSystem 
$mor = Get-View -MoRef $dtsystem
$dateConfig = New-Object Vmware.Vim.HostDateTimeConfig 
$hsntpConfig = New-Object VMware.Vim.HostNtpConfig 
$dateConfig.ntpConfig = $hsntpConfig 
$dateConfig.ntpConfig.server = @(&lt;font color="red"&gt;&amp;quot;&amp;lt;Your NTP Server&amp;gt;&amp;quot;&lt;/font&gt;) 
$dateConfig.timeZone = &lt;font color="red"&gt;&amp;quot;&amp;lt;Your Timezone&amp;gt;&amp;quot;&lt;/font&gt;
$mor.updateDateTimeConfig($dateConfig)
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
Q: How can I rescan Host Bus Adapters (HBAs)?&lt;br /&gt;
A: This script used to rescan Host Bus Adapters (HBAs).&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-java"&gt;connect-viserver -server &amp;lt;server&amp;gt; -user &amp;lt;user&amp;gt; -password &amp;lt;pwd&amp;gt;
get-vmhost | Get-VMHostStorage -RescanAllHBA
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
Q: How can I display and configure the physical adapters of my ESX host.&lt;br /&gt;
A: This script display the list of physical adapters of an ESX host.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-java"&gt;connect-viserver -server &amp;lt;server&amp;gt; -user &amp;lt;user&amp;gt; -password &amp;lt;pwd&amp;gt;
Get-VMHost | % &lt;font color="navy"&gt;{&lt;/font&gt;Get-View $_.ID&lt;font color="navy"&gt;}&lt;/font&gt; | % &lt;font color="navy"&gt;{&lt;/font&gt;$_.name; $nics = $_.config.network.pnic; foreach ($nic in $nics)&lt;font color="navy"&gt;{&lt;/font&gt;$nic.device&lt;font color="navy"&gt;}&lt;/font&gt;&lt;font color="navy"&gt;}&lt;/font&gt; 
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
This script can be used to configure the physical adapters of ESX host.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-java"&gt;connect-viserver -server &amp;lt;server&amp;gt; -user &amp;lt;user&amp;gt; -password &amp;lt;pwd&amp;gt;
 
# $nics will hold an array of physical NICs on the server.
$nics = (get-vmhost | get-vmhostnetwork).PhysicalNic
 
$nics | where &lt;font color="navy"&gt;{&lt;/font&gt; $_.DeviceName -eq &lt;font color="red"&gt;&amp;quot;NIC_TO_CONFIGURE&amp;quot;&lt;/font&gt; &lt;font color="navy"&gt;}&lt;/font&gt; | Set-VMHostNetworkAdapter -duplex full -bitratepersecmb 100
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
Q: How can I power off an ESX host?&lt;br /&gt;
A: This script can be used to power off an ESX host.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-java"&gt;connect-viserver -server &amp;lt;server&amp;gt; -user &amp;lt;user&amp;gt; -password &amp;lt;pwd&amp;gt;
$HS = Get-VMHost YOURHOST | get-view
$HS.ShutdownHost(&lt;font color="red"&gt;&amp;quot;false&amp;quot;&lt;/font&gt;)
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
&lt;h2&gt;Reporting:&lt;/h2&gt;
Q: How can I create a tabular report of all my VMs, including their configurations and amount of disk space allocated?&lt;br /&gt;
A: This script can be used for tabular reporting of all VMs with their configuration.&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-java"&gt;connect-viserver -server &amp;lt;server&amp;gt; -user &amp;lt;user&amp;gt; -password &amp;lt;pwd&amp;gt;
get-vm | % &lt;font color="navy"&gt;{&lt;/font&gt; get-view $_.ID &lt;font color="navy"&gt;}&lt;/font&gt; | Select-Object Name, @&lt;font color="navy"&gt;{&lt;/font&gt; Name=&lt;font color="red"&gt;&amp;quot;MemoryMB&amp;quot;&lt;/font&gt;; Expression=&lt;font color="navy"&gt;{&lt;/font&gt;$_.Summary.Config.memorySizeMB&lt;font color="navy"&gt;}&lt;/font&gt;&lt;font color="navy"&gt;}&lt;/font&gt; , @&lt;font color="navy"&gt;{&lt;/font&gt; Name=&lt;font color="red"&gt;&amp;quot;MemReservation&amp;quot;&lt;/font&gt;; Expression=&lt;font color="navy"&gt;{&lt;/font&gt;$_.Summary.Config.memoryReservation&lt;font color="navy"&gt;}&lt;/font&gt;&lt;font color="navy"&gt;}&lt;/font&gt; , @&lt;font color="navy"&gt;{&lt;/font&gt; Name=&lt;font color="red"&gt;&amp;quot;numCpu&amp;quot;&lt;/font&gt;; Expression=&lt;font color="navy"&gt;{&lt;/font&gt;$_.Summary.Config.numCpu&lt;font color="navy"&gt;}&lt;/font&gt;&lt;font color="navy"&gt;}&lt;/font&gt; , @&lt;font color="navy"&gt;{&lt;/font&gt; Name=&lt;font color="red"&gt;&amp;quot;numVirtualDisks&amp;quot;&lt;/font&gt;; Expression=&lt;font color="navy"&gt;{&lt;/font&gt;$_.Summary.Config.numVirtualDisks&lt;font color="navy"&gt;}&lt;/font&gt;&lt;font color="navy"&gt;}&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;p /&gt;
&lt;h2&gt;Other:&lt;/h2&gt;
Q: How can I create folders that appear under "Hosts and Clusters" in VC (a so-called "Blue Folder")?&lt;br /&gt;
A: A "Blue Folder" is a folder created under the VM folder.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-java"&gt;connect-viserver -server &amp;lt;server&amp;gt; -user &amp;lt;user&amp;gt; -password &amp;lt;pwd&amp;gt;
Get-Folder vm | New-Folder -Name &amp;amp;amp;ldquo;Target-Folder-Name&amp;amp;amp;rdquo;
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Q: I'm concerned about the security implications of Invoke-VMScript, how can I disable it?&lt;br /&gt;
A: Invoke-VMscript can be disabled on a VM-by-VM basis by adding this line to the VM's VMX file: monitor_control.restrict_backdoor = "true" . You can add this line by hand or you can add it with the following script:&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;$vmsToDisableInvoke = Get-VM &amp;lt;vms to reconfigure&amp;gt;
$vmsToDisableInvoke | foreach {
  $vm = Get-View $_.Id
  $vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
  $vmConfigSpec.extraconfig += New-Object VMware.Vim.optionvalue
  $vmConfigSpec.extraconfig[0].Key=&amp;quot;monitor_control.restrict_backdoor&amp;quot;
  $vmConfigSpec.extraconfig[0].Value=&amp;quot;true&amp;quot;
  $vm.ReconfigVM($vmConfigSpec)
}
&lt;/code&gt;&lt;/pre&gt;</description>
      <category domain="http://communities.vmware.com/tags?communityID=2530">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">cmdlet</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">virtualcenter</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">automation</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">faq</category>
      <pubDate>Thu, 03 Apr 2008 04:25:34 GMT</pubDate>
      <author>cshanklin@vmware.com</author>
      <guid>http://communities.vmware.com/docs/DOC-4210</guid>
      <dc:date>2008-04-03T04:25:34Z</dc:date>
      <clearspace:dateToText>9 months, 4 weeks ago</clearspace:dateToText>
      <clearspace:replyCount>3</clearspace:replyCount>
    </item>
    <item>
      <title>PowerShell Remoting with Feedback und Targeting</title>
      <link>http://communities.vmware.com/docs/DOC-4050</link>
      <description>&lt;br /&gt;
Hey&lt;br /&gt;
&lt;p /&gt;
take a look at this extremely cool tool, which allows you to schedule and target your PowerShell scripts.&lt;br /&gt;
&lt;p /&gt;
And if this was not enough... you also get a feedback of the results.&lt;br /&gt;
&lt;p /&gt;
&lt;a class="jive-link-external" href="http://www.specopssoft.com/powershell/"&gt;http://www.specopssoft.com/powershell/&lt;/a&gt;</description>
      <category domain="http://communities.vmware.com/tags?communityID=2530">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">remoting</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">feedback</category>
      <pubDate>Mon, 31 Mar 2008 16:58:16 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-4050</guid>
      <dc:date>2008-03-31T16:58:16Z</dc:date>
      <clearspace:dateToText>1 year, 7 months ago</clearspace:dateToText>
      <clearspace:replyCount>4</clearspace:replyCount>
    </item>
    <item>
      <title>VI Toolkit (for Windows) Admin Guide</title>
      <link>http://communities.vmware.com/docs/DOC-3740</link>
      <description />
      <pubDate>Wed, 19 Mar 2008 16:02:40 GMT</pubDate>
      <author>cshanklin@vmware.com</author>
      <guid>http://communities.vmware.com/docs/DOC-3740</guid>
      <dc:date>2008-03-19T16:02:40Z</dc:date>
      <clearspace:dateToText>1 year, 8 months ago</clearspace:dateToText>
    </item>
    <item>
      <title>Creating a PSDrive to browse your inventory</title>
      <link>http://communities.vmware.com/docs/DOC-3610</link>
      <description>(I can't take credit for this, I'm just formatting and publishing instructions received from VMware.)&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Establish a connection to your the server using the Connect-VIServer command: &lt;br clear="all" /&gt; 	&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;Connect-VIServer -Server
&lt;/code&gt;&lt;/pre&gt;  &lt;br clear="all" /&gt; 	for example, &lt;br clear="all" /&gt; 	&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;Connect-VIServer -Server 192.168.10.10
&lt;/code&gt;&lt;/pre&gt;&lt;br clear="all" /&gt; 	When prompted, provide the administrator's username and password to authenticate access on the server.&lt;/li&gt;
&lt;li&gt;Get the root folder of the server: &lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;$root = Get-Folder -NoRecursion
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Create a PowerShell drive named VI, based on the server root folder. You can use the built-in New-psDrive cmdlet. &lt;br clear="all" /&gt; &lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;New-PSDrive -Location $root -Name vi -PSProvider VimInventory -Root '\'
&lt;/code&gt;&lt;/pre&gt; &lt;br clear="all" /&gt; In this release, a single backslash is the required value for the -Root parameter.&lt;/li&gt;
&lt;li&gt;Access the new drive by typing the following command: &lt;br clear="all" /&gt; &lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;cd vi:
&lt;/code&gt;&lt;/pre&gt; &lt;br clear="all" /&gt; To list the drive content, use Get-ChildItem or its alias Dir.&lt;/li&gt;
&lt;li&gt;Navigate through your server inventory using the cd command with the full path to the host. For a fictional VI inventory it may looks like the following: &lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;cd Folder01\DataCenter01\host\Web\LiveHost01
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;</description>
      <category domain="http://communities.vmware.com/tags?communityID=2530">psdrive</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">new-psdrive</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">inventory</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">provider</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">viminventory</category>
      <pubDate>Sat, 15 Mar 2008 18:33:25 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-3610</guid>
      <dc:date>2008-03-15T18:33:25Z</dc:date>
      <clearspace:dateToText>1 year, 1 week ago</clearspace:dateToText>
    </item>
    <item>
      <title>Script: Get-FolderContents</title>
      <link>http://communities.vmware.com/docs/DOC-2612</link>
      <description />
      <category domain="http://communities.vmware.com/tags?communityID=2530">folder</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">vm</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">get-view</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">get-folder</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">get-vm</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">find-entityview</category>
      <category domain="http://communities.vmware.com/tags?communityID=2530">connect-vim</category>
      <pubDate>Fri, 25 Jan 2008 17:03:15 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-2612</guid>
      <dc:date>2008-01-25T17:03:15Z</dc:date>
      <clearspace:dateToText>1 year, 1 month ago</clearspace:dateToText>
      <clearspace:replyCount>1</clearspace:replyCount>
    </item>
  </channel>
</rss>

