VMware

how to get the correct Virtual Disk for a VMware vm

Some times I have the problem, I need to resize or delete a VMware virtual disk, but I only know the guest’s drive letter. In vm’s where there are only one virtual disk, or where each virtual disk has a different size, this isn’t a problem. but if you have a vm with multiple virtual disk with exactly the same size, you can’t compare it between the guest Disk Manager and the virtual disk sizes. if your vm has more than one SCSI controller, the problem will increase.

Windows Disk Manager VMware VM settings

I searched long time to solve this problem, but I couldn’t find an easy solution for this. so I wrote this PowerShell script:

when you run the script, it will ask you for credentials and then shows you the informations about booth of your virtual disk and Windows drive : read more

With PowerCLI, you can add AD authentication to a single managed ESXi Host. For this you need to add your ESXi-Host to the AD (line 9) and then add permissions (line 11):

sometimes line 11 will fail, then you have to wait for domain replication and repeat it.

i like vCheck to daily report my virtual environment status. But a lot of our guest systems are not in my responsibility, so the VM Tools are not uptodate or aren’t installed.

i wroted this plugin for vCheck:

Installing HP ESXi Offline Bundle for VMware ESXi 5.0

The steps to install the offline bundle for VMware ESXi 5.0 has changed from VMware ESXi 4.X. The vihostupdate command used in ESXi 4.X does not work against ESXi 5.0 hosts.

1. Download the bundle.zip.

Either Google “HP ESXi Offline Bundle for VMware ESXi 5.0” or go to www.hp.com → Support & Drivers → Drivers & Software → Search for the server model (e.g. ProLiant BL640c) → Select the server series → Select operating system = VMware ESXi 5.0 → Find “* RECOMMENDED* HP ESXi Offline Bundle for VMware ESXi 5.0 → Download read more

discover informations about all virtual machines to Excel

I had the task to list all existing virtual machines in our vSphere vCenter to an Excel-List. Cause i have alot of VM’s and they change often, i wrote a powershell-script, which creates an excel-file like this:

The requirements for this script are Microsoft Excel and VMware PowerCLI 5. Look at the script or download it here:

Anyone out there who runs a successful Microsoft Windows Active Directory, knows that it is pre-eminently useful to have a test environment that very nearly represents your production environment…to do…you know…testing!

I thought I would give that a try, and here’s what I came up with:

  1. Shutdown and clone a Virtual Domain Controller with a 50GB disk drive, 10 minutes.
  2. Attach the virtual DC to a totally private network, visible only to other virtual machines on the same box, 15 seconds.
  3. Restart the cloned DC, 1 minute.
  4. Seizing FSMO roles from Domain Controllers that aren’t in this private network, 3 minutes.
  5. Sit back in wonder, 45 seconds.

These simple steps aren’t completely error free. Because the DC I chose was a replication partner with a bunch of other DCs and Active Directory Sites, it was necessary to do some tweaking to remove the “defunct” Domain Controller properties from the Active Directory. That process is documented well, here: Remove old Domain Controller Settings from FRS and the Domain. If you have a lot of Remote Domain Controllers and you only need your clon e for a little test, it may be to expensive to remove all remote DC’s. In this case you can create this registry value, so your clone isn’t waiting anymore for replication partner: read more

To shutdown a VMware datacenter on UPS failure i found a PowerShell script, which i modified:

The script will shutdown the desired VMware datacenter, but it will ask you first, if you are sure. If you like to run the script in silent mode, you can run it with parameter yes.

You have to define the hostname of your VirtualCenter and the name of the datacenter. To run the script, you will need, to have VMware PowerCLI installed.

You can dowload the script shutdownESX.ps1 (right-click -> Save As) or copy/paste it from here:

read more

ESXi 4.1 Default-Screen

The ESXi 4.x installer utilizes the default blocksize of 1MB when creating VMFS volumes, allowing for storage of files 256GB and under. This default VMFS Datastore cannot be easily reformatted with a higher blocksize as it contains the Service Console VMDK file. But to store files greather than 256 GB (ex. VMDK), you have to use a blocksize greather than 1 MB on your partition. If you use your system-partition for saving VMDK-Files greather than 256 GB, you have to change the blocksize of your system-partition. Unfortunately VMware doesn’t give you the possibilty to do this during the installation. So you have to do this with a trick after the installation: Install the VMware ESXi 4.x host as always. After the installation follow this steps: ESXi 4.1 Default-Screen Press the Funktion-Key F2 ESXi 4.1 Logon-Screen Logon with your root-account. Troubleshooting Options Select Troubleshooting Options. Select Enable Local Tech Support. After you enabled the local Tech Support, press two times the Key ESC, to exit to the Default Screen. ESXi 4.1 Default-Screen Press the Key-Combination ALT+F1 to enter the local Tech Support. You have to logon again on the console screen. After you loged in, run the follow command: You will receive the informations about all installed Drives: Now run this command:

For <BLOCKSIZE> use the value from the next table. For <DRIVE-ID> use the value received from the last command (marked yellow in example):
block size maximum file-size on vmfs3
1 MB 256 GB
2 MB 512 GB
4 MB 1 TB
8 MB 2 TB
The process did run for around 20 seconds on my 1 TB disk. After succesfull running, press the Key-combination ALT+F2, to exit to the default window. Please disable now the Local Tech Support and make a reboot.