Friday, June 29, 2012

vCenter Recovery

I had come across a instance where my vCenter Crashed and it didn't want to start. Tried many things to troubleshoot.
In order to get the things sorted out I reinstalled vCenter on another VM with the existing database. (This may not be the right thing to do)
I would like to share the steps which i followed.

Snapshots

Just wanted to share couple of 1 liners related to Snapshots listing and deletion


List all the Snapshots
--------------------------------------

Get-VM | Get-Snapshot


Delete all the Snapshots
------------------------------------------

$snapshot = Get-VM | Get-Snapshot
Remove-Snapshot -Snapshot $snapshot -RemoveChildren -Confirm:$False

Friday, June 22, 2012

VM Creation Script

Yesterday I wrote an article about Customization Specification Manager.
Post writing I thought why not try create VM using Power CLI
I have manage to put together script which creates VM Specifying following values

1. Template
2. Customization Specification
3. ESXi Host
4. Resource Pool
5. Datastore
6. Folder
7. Port Group

Please feel free give your comments 
To download the script Click Here

Thursday, June 21, 2012

Customization Specifications Manager


When you clone or deploy a VM from a template, you can customize the guest operating system of the VM to modify properties such as the computer name, network settings, and license settings.
Benefit
Customizing guest operating systems can help prevent conflicts that can result if virtual machines with identical settings are deployed, such as conflicts due to duplicate computer names.
Procedure
1.       In vSphere Inventory Click Home --> Customization Specifications Manager-->New
 
2.       Specify the Owner Details as you would normally do when you install the Windows OS
3.       In this Step you have to specify the Computer Name. There are 4 Options
a.       Specify the Name Manually
b.      User Virtual Machine Name
c.       Ask the User When Deploying Virtual Machine
d.      Generate Random Name using Script 
4.       Specify the licensing Information
5.       Specify the password for the Administrator Account
6.       Specify the Time Zone for the Windows OS
7.       If you want to run a Command/Script you can specify it here. Example would be Logon Script
8.       Next in line is Network Settings. There are 2 Options
a.       Typical Settings
b.      Custom Settings
9.       First Network Settings is NIC. You can configure NIC Properties
10.   Second Network Settings is to Specify the Domain/WorkGroup Settings
11.   Next in turn is Generate New Security ID (SID)
12.   Review the details and confirm to Create Customization
13.   Once it is created it can be used when deploying VM