A. Mikkelsen

VMware ESX scripts, commands, tools and other nice to know things that will make your virtualization days easier!!!!

Project Onyx Alpha Release

No comments

Finally everyone outside the closed beta is now able to get hands on with the cool application Project Onyx.
Thanks to Carter Shanklin

Project overviewGot it from http://www.ntpro.nl/blog/archives/1330-Project-Onyx-Alpha-Release.html

Onyx is a standalone application that serves as a proxy between the vSphere Client and the vCenter Server. It monitors the network communication between them and translates it into an executable PowerShell code. Later, this code can be modified and saved into a reusable function or script.

  1. To connect to a server, click the “Connect” icon.
  2. Enter the IP of the vCenter Server on which you want to work and click Connect.
  3. Connect with any of the following clients:For vSphere Client, in the “IP Address” field enter the following address:
    http:// [IP of the machine where Onyx is running] : [listening port]

    For vSphere PowerCLI, run the following command:
    Connect-VIServer [IP of the machine where Onyx is running] -Protocol http
    -Port [listening port] -User [username] -Pass [password]

  4. To start the generation of PowerCLI.NET scripts, click the “Start” icon.
  5. To save the generated script, click the “Save output to file” icon.

You can download Project Onyx Alpha from http://blogs.vmware.com/files/onyx_1.5.3607.25516.zip or http://bit.ly/vmwOnyx15.

To learn how it works please see this video from YouTube.com

If you are looking for a easy and simple guide for setting up iSCSI on vSphere (ESX 4.x) you might want to take a look at this guide from www.techhead.co.uk
http://www.techhead.co.uk/vmware-esxi-4-0-vsphere-connecting-to-an-iscsi-storage-target

Many admins have upgraded to Windows 7 and gotten into problems when trying to install the vSphere Client.

I have found a few guides to do a workaround, but the best guide is found at techhead.co.uk.
http://www.techhead.co.uk/running-vmware-vsphere-client-on-windows-7

Thanks to Kiwi Si.

Yesterday I by mistake extended a disk on a VM that had snapshots.
Using vmkfstools.
Kind of like this thread (http://communities.vmware.com/thread/238035).

This resulted in the following PowerOn error:

Failed to power on Servername on Host in Cluster:

Cannot open the disk ‘/vmfs/volumes/LUN/Folder/VM.vmdk’
Reason: The parent virtual machine disk has been modified since the child was created

The server was a database server so I had no choice than to fix it.

I tried the following with no luck:

  • Reverting to snapshot didn’t help – (Don’t try this if you don’t have a good backup)
  • Shrinking the vmdk again using vmkfstools – (This has not been possible since ESX 3.0)

Then I tried to use VMware Converter to do a V2V and in the first try (all defaults) that didn’t help the VM started with a BSOD.I tried again using the Converter but this time I changed one default parameter.In the “View/Edit Options” tap, remove the check mark in “Reconfigure destination virtual machine” and click YES to the warning.Removing the reconfigure option saved my day.
The VM started and I was able to restore the latest files from backup.


This PowerShell script adds a host to a Cluster and licenses it.


Add-PSSnapin VMware.VimAutomation.Core
Connect-VIServer "VC_server_name" -User "Administrator" -Password "password"
add-vmhost "esxhost" -location (get-datacenter -name 'Datacenter' |
   get-folder -name 'Folder' | get-cluster -name 'Cluster') -user "root"
   -password "password" -force: $true
$targethostMoRef = (get-VMHost $strHost  | get-view).MoRef
$si = Get-View ServiceInstance
$LicManRef=$si.Content.LicenseManager
$LicManView=Get-View $LicManRef
$licassman = Get-View $LicManView.LicenseAssignmentManager
$licassman.UpdateAssignedLicense($targethostMoRef.value,”YOUR LIC KEY”,
   ”vSphere4 Enterprise Plus (1-12 cores per CPU”)
Disconnect-VIServer -Confirm:$false

Download it here.

Last week I upgraded a Virtual Center server from Win2003 & MSSQL 2000 (32-bit) to Win2008 & MSSQL 2005 (64-bit).

During the installation of vCenter it asked for a 32-bit ODBC even though all the new systems was running 64-bit.
After a some time on Google i found that Windows 64-bit also includes a 32-bit version of the ODBC.

To set up a 32-bit DSN launch the 32-bit version of the Data Source Administrator. It is located at:
%systemdrive%\Windows\SysWoW64\Odbcad32.exe

Also se
http://www.vmwarewolf.com/32-bit-odbc-dsn-for-vsphere/

Duncan Epping has released a great post on how to partition your ESX 4.0 (vSphere) using scripting and the grafical installer

http://www.yellow-bricks.com/2009/05/27/partitioning-your-esx-host-part-ii/

You cannot define the sizes of the /boot, vmkcore, and /vmfs partitions when you use the graphical or text installation modes. You can define these partition sizes when you do a scripted installation.

The ESX boot disk requires 1.25GB of free space and includes the /boot and vmkcore partitions. The /boot partition alone requires 1100MB.

The vmcore is created automatically by the installer

Primary:
/     - 5120MB
Swap  - 1600MB
Extended Partition:
/var  - 4096MB
/home - 2048MB
/opt  - 2048MB
/tmp  - 2048MB

Today when I needed to upgrade my VC database from MSSQL2000 to MSSQL 2005 i came upon these quick guides.

http://blog.core-it.com.au/?p=27

http://spininfo.homelinux.com/news/VirtualCenter/2008/01/06/Howto_Move_Migrate_Design_VC_DB_from_SQL2000_to_SQL2005__

Howto add webages in vCenter

No comments

If you want to add a website tab to your vCenter, then here is a quick way to do it.

http://www.ntpro.nl/blog/archives/1270-vSphere-Plugin-Wizard-Released.html

Thanks to Ricky over at virtualizeplanet.com

Have you ever needed to document how secure your ESX servers are.

If the answer is yes then take a look at these free fools (Compliance Checkers) from ConfigureSoft.com.
http://www.configuresoft.com/compliance-checker.aspx

If the answer is no I would sugest you took a look at the tools anyway……

Compliance Checker for VMware ESX, checks the compliance of VMware ESX hosts against VMware hardening guidelines and Center for Internet Security (CIS) benchmarks.

Compliance Checker for PCI DSS, checks the compliance of servers and desktops against PCI DSS v1.2 requirements as specified by PCI Security Standards Council.

VMware have released a demo on YouTube that shows a “must have” for PowerShell users who automate and manage vSphere and vCenter through PowerShell.

The project is named “Onyx” and works like a middelware between the vCenter Client and the vCenter Server.
Onyx is unfortunately still in a private beta and therefore not acceble to the Public…….. :-(

Read more on rtfm-ed.co.uk.
http://www.rtfm-ed.co.uk/?p=1643

Or read more on the “get-scripting podcast” blog
http://get-scripting.blogspot.com/2009/08/get-scripting-podcast-episode-12-carter.html

http://communities.vmware.com/message/1286580#1286580

http://www.ivobeerens.nl/?p=256

http://www.configuresoft.com/esx-compliance-checker.aspx

http://www.vmware.com/support/developer/vima/

http://www.run-virtual.com/?p=233 (VMware CPU Host Info)

http://teckinfo.blogspot.com/2009/01/vdiagram-document-your-vi-with-one.html (vDiagram)

Simon Long has posted a great test exam for the VCP410 exam.
I used it to study for mine.
http://www.simonlong.co.uk/blog/vcp-vsphere-4-practice-exam/

Also take a look at Somins study notes.
http://www.simonlong.co.uk/blog/vcdx-study-notes/

Another great and very usefull help is to use and memorize the vReference Card.
http://www.vreference.com/

Thanks to VCP for the below study sites
http://www.passguide.com/vcp-410.html
http://www.vcp-410.com

And not to forget Scott Vessey who created a great collection of resources for studying
http://vmwaretraining.blogspot.com/2009/09/studying-for-vcp-on-vsphere-4.html

Passed VCP410

9 comments

Yesterday I passed the VCP401 exam with 375 points.

I feel that the exam was harder than the old exam (VCP310).
Think VMware has realized this and dropped the target for VCI from 400 to 350 points.

Over the past few months we have seen a few Windows servers with a black screen.
Meaning

  • You can’t see the logon promt
  • You get a black screen when you connect with RDP

We found that the problem was caused by a change in the Windows color scheme.

The solution is to copy the color scheme from a simular Windows servers registry and add it the VM/server that has the problem using registry to connect to a remote server.

  1. On a simular windows server locate “[HKEY_USERS\.DEFAULT\Control Panel\Colors]” and export it to a file.
  2. Using the same Registry Editor connect to the remote server.
  3. Import the registry file just created or change the color scheme manually.
  4. Reboote the affected server to change the color scheme.

Default color scheme for a Windows 2003 server.
Default color scheme for a Windows XP.
Default color scheme for a Windows 2000 server.
Default color scheme for a Windows 2008 server.

TeckHead.com has released a list of free tools and scriptrs for your VMware enviroment.

The list will be updated with new tools and scripts when ever new are found …

Read the list here.

After almost 2 years of silence a new version of the ESXHealthScript has surfaced.

Version 0.30 is released.

In this demo Ben (@xcud) takes a PowerCLI script that’s been transcribed into workflow activities and drop a ‘ToWMI’ activity at the end which causes the workflow to push the data retrieved from PowerCLI into WMI when the workflow is run. The workflow is set to run automatically every 5 seconds by being deployed as a Task in the Agent. The data is shown both on the PowerShell commandline and in a PowerGadget digital readout. Download the beta now: http://powerwf.com/

(Text copied from NTPRO.NL)

If you want to perform an offline upgrade of an ESX 3.x host to the new vSphere  host there are a few ways.

Using a DVD:

/root/esxupgrade.sh storage1

Using the DVD ISO:

esxupgrade.sh -i /vmfs/volumes/storage1/esx4.iso /vmfs/volumes/storage1

storage1 – should be a VMDK local datastore attached to the host.
storage1 – should be at least 8.4GB in size.

Read the full guide here.

But ESX as a VM with running VM’s is new.

It’s now possible to run ESX as a VM on an ESX server or in a Workstation.

See howto
http://www.vcritical.com/2009/05/vmware-esx-4-can-even-virtualize-itself/

Powered by WordPress Web Design by SRS Solutions © 2010 A. Mikkelsen Design by SRS Solutions