Now that we know some of the tools that are available to manage ESXi hosts, lets use one to create a virtual machine, in this case importing a virtual appliance available as an OVF. Before we do that, one tiny piece of business to take care of; creating a datastore for our virtual ESXi hosts. In our home lab environment, adding a local datastore to an ESXi host is as easy as editing the virtual machine properties in VMware Workstation. Right click on the ESXi virtual machine and select Settings; click the Add.. button at the bottom of the Settings window and select hard disk. Follow the wizard to place the file in the desired location.

In my case I am going to create two additional drives on vxprt-esxi01 - one on my SSD Windows volume (40GB) , and 1 on the RAID0 (100GB), they will be named “gold” and “silver” in ESXi to represent performance of each. Once each of the new hard disks have been added in VMware Workstation, we can launch the vSphere Client to create the datastores which could be used to store virtual machines.

Open the vSphere Client, connect to 192.168.6.11 as root

Select the host in the left navigation pane and then click the configuration tab

Under Hardware, click on Storage

Click on Rescan All... then click OK

Click on Add Storage

When the wizard launches, select Disk/LUN and click Next

You should see your 40GB and 100GB LUNs you added in VMware Workstation (or whatever size you selected)

Select the 40GB SSD LUN and click Next

Select VMFS-5 and click Next, and Next again

Enter a name for the datastore, I am using vxprt-esxi01-gold-local and vxprt-esxi01-silver-local

Use the Maximum space available and click Next, then finish

Repeat the steps again for the 100GB “silver” LUN, you should now have two datastores available to your ESXi host.

Later on this series we will see how to turn those into VSAN storage, for now its a location to review importing OVF’s and creating other virtual machines.

So had a need to clone a vApp several times, I finally got around to automating that task thanks again to PowerCLI. A few things I had to consider; with the New-VApp cmdlet you cannot select portgroups so I had to do that after the vApp was cloned and also needed to put the vApp into a specific folder after it was cloned. Other than those two considerations, it was actually kind of easy to figure out (at least based on what I needed to accomplish). Two thing I could not do in this script - place the cloned vApp into a datastore cluster and allow storage DRS to make the initial placement. Instead, I am relying to SDRS to balance the datastores after the power on operation. Also I could not force the virtual disk format size, I want them all thick, eager zeroed so instead I ensured the source vApp was set properly.

In the last post we looked quickly at importing the vCenter Server Appliance through the vSphere Client, however its high time we introduce PowerCLI. PowerCLI is a set of PowerShell cmdlets to manage your VMware environments (vSphere, vCloud Director and View) and is quite powerful. So powerful in fact that this is going to be a pretty short post, the 7 bullet points needed just to import the OVF through the vSphere Client is now a single command!