Last minute entry...Its great !

A last minute entry has just come into the VMware PowerShell Comp and its very good....

This script will generate 2 .txt file reports based on your virtual environment.

The first report (report.txt) includes resource utilization across all Clusters including CPU and Memory usage for the cluster as a whole as well as each individual ESX host.
It will also list the VM to Host Ratio for the cluster.

The latter portion of the report includes an overview of total Datastore space allocated to the environment as well as space available and the amount of space used by powered off VMs.

The first report finishes off with a listing of all datastores with details on available space, capacity and % used.The second report is a hotlist (hotlist.txt which includes VM's that are using, on average, more than 75% of their allocated memory.

It also includes hosts that are using more than 75% of their Memory or CPU.
It continues by listing datastores with less than 10% of their capacity available.
Finally it pulls WARNING messages from each ESX host's VMKernel log since the beginning of the previous day.

The first report (report.txt) is designed to bring a high level view of the environment for reporting purposes as well as for making decisions on where additional resources may need to be allocated on a cluster level.
It is particularly useful for providing numbers up the chain of command without needing to pore through Virtual Center collecting data.

The second report is useful from a health check standpoint. It automatically identifies vm's and hosts that are running hot to give an analyst an idea of where they may need to look into problems.

The datastore report is useful for determining ahead of time when additional storage needs to be allocated and where it should be used. Perhaps the most useful part of the report is the ESX logs. It's a single place for analysts to watch for early signs of issues that may not be apparent when just using Virtual Center.

The script is a perfect item to run at the beginning of the day before heading down the hall to grab a cup of coffee.

Check it out here

VI Export Script - Whats next

I have had some great comments so far on my script, so I thought I would start thinking about the next version, let me know what you want.

So far.......

An Index page with linkable subjects to the following:

Index

Virtual Center

-> Cluster information

-> Resource Pool information

-> Snapshot information

-> Vlan Information

Esx Hosts

-> Host Information

-> Host Configuration

-> -> Hardware

-> -> Processor

-> -> Memory

-> -> Storage

-> -> Networking

-> -> Storage Adapters

-> -> Network adapters

Software

-> Licensed features

-> Time Configuration

-> DNS and Routing

-> Virtual Machine Startup/Shutdown

-> Virtual machine Swapfile Location

-> Security Profile

-> System resource Allocation

Virtual Machines

-> Vm information Client folder X (name,os,cpu,mem,disk,tools version,power,discr.)

-> Vm information Client folder Y name,os,cpu,mem,disk,tools version,power,discr.)

-> Vm information Client folder Z (name,os,cpu,mem,disk,tools version,power,discr.)

Datastores

-> Datastore information


Options to run the script:

Report.ps1 virtalcenterserver /All

Report.ps1 virtalcenterserver /only VC and ESX Host configuration

Report.ps1 virtalcenterserver /only vms in map X


Thanks to Greetz for the ideas.

Virtualise in Minutes with VMware ESXi

Now its free why not give it a go with help from this new podcast from VMware...

VMware ESXi is the leanest, meanest hypervisor on the market today.

Discover the benefits of VMware virtualisation by learning how to get started in four easy installation steps.

Speakers:
John Gilmartin, Group Product Manager, Product Marketing, VMware Amir Sharif, Sr. Product Manager, Product Marketing, VMware

Listen: Listen or Download MP3 * (7 MB 10:15 mins)

Check Active Directory Latency Script

Here is a neat Powershell script that:
  • Finds all Domain Controllers in the Domain (using .NET)
  • Creates a contact object in a specified OU (Default is users container for the Domain)
  • Gets the start Time
  • Loops and Checks each DC for the object.
  • Once all DCs have the object it gets End Time
  • Outputs the results

Basically you can check how long it takes to replicate to each of your sites. Very Usefull !

Bigup Myself !

Im starting to get famous, very slowly my plan to virtualise the world is coming together (as I once said.. Virtualise the world, Virtualise the cheerleader)

My script which exports configuration information from Virtual Center straight into MS Word has now been used by a fair few poeple and it seems to be working, which is good as I couldnt give it the testing I would have liked to.

1. A few people in the forum have been using it and comments are good .....link here

2. I had an email from someone who used it against there system running it over a VPN connection to the VI Server with over 20 ESX servers and over 250 VM's, the script produced a 1.56 MB which has 50 pages. large scale testing !!!

3. I had a mention in the get-scripting podcast (I havnt sync'd my zune yet but will listen when I get home today), thanks Jonathan.

VI 4 ?

Ok, im not sure if this is true or not but I have heard a couple of ramblings about VI4 recently, I didnt even know there was a VI4 beta.

I wonder if there will be any more news at VMWorld (September 15-18)

Change DNS and WINS on multiple servers

OK, so you have just rebuilt your DNS/WINS server and it has a new IP address, now you have to log into every server that you gave a static address to and update the DNS/WINS...or do you ?

Not anymore, thanks to FatBeard

The following powershell script will do it for you by using PowerShell, you only need PowerShell on the machine you are running it from, not the servers you are changing as this is done through WMI. Even reads the server name entries from a text file !

function Set-DNSWINS {
#Get NICS via WMI
$NICs = Get-WmiObject '
-Class Win32_NetworkAdapterConfiguration '
-ComputerName $_ '
-Filter "IPEnabled=TRUE"

foreach($NIC in $NICs) {
$DNSServers = "12.34.5.67","76.54.3.21"
$NIC.SetDNSServerSearchOrder($DNSServers)
$NIC.SetDynamicDNSRegistration("TRUE")
$NIC.SetWINSServer("12.345.67.890", "12.345.67.891")
}
}

function Get-FileName {
$computer = Read-Host "Filename of computer names?"
return $computer
}

$f = Get-FileName
Get-Content $f foreach {Set-DNSWINS}

Powershell get-member fun

Ok, as a newbie to Powerhsell it still amazes me how clever it is, whilst i was writing my recent report script which takes the results of various commands and outputs them to a word document for a report I was stuck with the properties of one of the objects.

I had been trying to translate some of the documented vbscript's from the msdn site and use the same features as there wasnt much documentation for doing this in powershell at the moment on the web, I really got stuck finding the properties so i experimeted with get-member, check this out...

$msWord = New-Object -Com Word.Application

Which creates a new word com object

$msword | get-member

Didnt expect this to do anything as how would powershell know the properties of a com object but wait, look what i recieved....

TypeName: System.__ComObject#{00020970-0000-0000-c000-000000000046}

Name MemberType Definition
---- ---------- ----------
Activate Method void Activate ()
AddAddress Method void AddAddress (SAFEARRAY(st...
AutomaticChange Method void AutomaticChange ()
BuildKeyCode Method int BuildKeyCode (WdKey, Vari...
CentimetersToPoints Method float CentimetersToPoints (fl...
ChangeFileOpenDirectory Method void ChangeFileOpenDirectory ...
CheckGrammar Method bool CheckGrammar (string)
CheckSpelling Method bool CheckSpelling (string, V...
CleanString Method string CleanString (string)
DDEExecute Method void DDEExecute (int, string)
DDEInitiate Method int DDEInitiate (string, string)
DDEPoke Method void DDEPoke (int, string, st...
DDERequest Method string DDERequest (int, string)
DDETerminate Method void DDETerminate (int)
DDETerminateAll Method void DDETerminateAll ()
DefaultWebOptions Method DefaultWebOptions DefaultWebO...
DiscussionSupport Method void DiscussionSupport (Varia...
GetAddress Method string GetAddress (Variant, V...
GetDefaultTheme Method string GetDefaultTheme (WdDoc...
GetSpellingSuggestions Method SpellingSuggestions GetSpelli...
GoBack Method void GoBack ()
GoForward Method void GoForward ()
Help Method void Help (Variant)
HelpTool Method void HelpTool ()
InchesToPoints Method float InchesToPoints (float)
Keyboard Method int Keyboard (int)
KeyboardBidi Method void KeyboardBidi ()
KeyboardLatin Method void KeyboardLatin ()
KeyString Method string KeyString (int, Variant)
LinesToPoints Method float LinesToPoints (float)
ListCommands Method void ListCommands (bool)
LookupNameProperties Method void LookupNameProperties (st...
MillimetersToPoints Method float MillimetersToPoints (fl...
MountVolume Method short MountVolume (string, st...
Move Method void Move (int, int)
NewWindow Method Window NewWindow ()
NextLetter Method void NextLetter ()
OnTime Method void OnTime (Variant, string,...
OrganizerCopy Method void OrganizerCopy (string, s...
OrganizerDelete Method void OrganizerDelete (string,...
OrganizerRename Method void OrganizerRename (string,...
PicasToPoints Method float PicasToPoints (float)
PixelsToPoints Method float PixelsToPoints (float, ...
PointsToCentimeters Method float PointsToCentimeters (fl...
PointsToInches Method float PointsToInches (float)
PointsToLines Method float PointsToLines (float)
PointsToMillimeters Method float PointsToMillimeters (fl...
PointsToPicas Method float PointsToPicas (float)
PointsToPixels Method float PointsToPixels (float, ...
PrintOut Method void PrintOut (Variant, Varia...
PrintOutOld Method void PrintOutOld (Variant, Va...
ProductCode Method string ProductCode ()
Quit Method void Quit (Variant, Variant, ...
Repeat Method bool Repeat (Variant)
ResetIgnoreAll Method void ResetIgnoreAll ()
Resize Method void Resize (int, int)
Run Method Variant Run (string, Variant,...
RunOld Method void RunOld (string)
ScreenRefresh Method void ScreenRefresh ()
SendFax Method void SendFax ()
SetDefaultTheme Method void SetDefaultTheme (string,...
ShowClipboard Method void ShowClipboard ()
ShowMe Method void ShowMe ()
SubstituteFont Method void SubstituteFont (string, ...
ToggleKeyboard Method void ToggleKeyboard ()
FindKey ParameterizedProperty KeyBinding FindKey (int, Vari...
International ParameterizedProperty Variant International (WdInte...
IsObjectValid ParameterizedProperty bool IsObjectValid (IDispatch...
KeysBoundTo ParameterizedProperty KeysBoundTo KeysBoundTo (WdKe...
SynonymInfo ParameterizedProperty SynonymInfo SynonymInfo (stri...
ActiveDocument Property Document ActiveDocument () {g...
ActivePrinter Property string ActivePrinter () {get}...
ActiveWindow Property Window ActiveWindow () {get}
AddIns Property AddIns AddIns () {get}
AnswerWizard Property AnswerWizard AnswerWizard () ...
Application Property Application Application () {g...
Assistant Property Assistant Assistant () {get}
AutoCaptions Property AutoCaptions AutoCaptions () ...
AutoCorrect Property AutoCorrect AutoCorrect () {g...
BackgroundPrintingStatus Property int BackgroundPrintingStatus ...
BackgroundSavingStatus Property int BackgroundSavingStatus ()...
BrowseExtraFileTypes Property string BrowseExtraFileTypes (...
Browser Property Browser Browser () {get}
Build Property string Build () {get}
CapsLock Property bool CapsLock () {get}
Caption Property string Caption () {get} {set}
CaptionLabels Property CaptionLabels CaptionLabels (...
CheckLanguage Property bool CheckLanguage () {get} {...
COMAddIns Property COMAddIns COMAddIns () {get}
CommandBars Property CommandBars CommandBars () {g...
Creator Property int Creator () {get}
CustomDictionaries Property Dictionaries CustomDictionari...
CustomizationContext Property IDispatch CustomizationContex...
DefaultSaveFormat Property string DefaultSaveFormat () {...
DefaultTableSeparator Property string DefaultTableSeparator ...
Dialogs Property Dialogs Dialogs () {get}
DisplayAlerts Property WdAlertLevel DisplayAlerts ()...
DisplayAutoCompleteTips Property bool DisplayAutoCompleteTips ...
DisplayRecentFiles Property bool DisplayRecentFiles () {g...
DisplayScreenTips Property bool DisplayScreenTips () {ge...
DisplayScrollBars Property bool DisplayScrollBars () {ge...
DisplayStatusBar Property bool DisplayStatusBar () {get...
Documents Property Documents Documents () {get}
Dummy1 Property bool Dummy1 () {get}
EmailOptions Property EmailOptions EmailOptions () ...
EnableCancelKey Property WdEnableCancelKey EnableCance...
FeatureInstall Property MsoFeatureInstall FeatureInst...
FileConverters Property FileConverters FileConverters...
FileSearch Property FileSearch FileSearch () {get}
FocusInMailHeader Property bool FocusInMailHeader () {get}
FontNames Property FontNames FontNames () {get}
HangulHanjaDictionaries Property HangulHanjaConversionDictiona...
Height Property int Height () {get} {set}
KeyBindings Property KeyBindings KeyBindings () {g...
LandscapeFontNames Property FontNames LandscapeFontNames ...
Language Property MsoLanguageID Language () {get}
Languages Property Languages Languages () {get}
LanguageSettings Property LanguageSettings LanguageSett...
Left Property int Left () {get} {set}
ListGalleries Property ListGalleries ListGalleries (...
MacroContainer Property IDispatch MacroContainer () {...
MailingLabel Property MailingLabel MailingLabel () ...
MailMessage Property MailMessage MailMessage () {g...
MailSystem Property WdMailSystem MailSystem () {g...
MAPIAvailable Property bool MAPIAvailable () {get}
MathCoprocessorAvailable Property bool MathCoprocessorAvailable...
MouseAvailable Property bool MouseAvailable () {get}
Name Property string Name () {get}
NormalTemplate Property Template NormalTemplate () {g...
NumLock Property bool NumLock () {get}
Options Property Options Options () {get}
Parent Property IDispatch Parent () {get}
Path Property string Path () {get}
PathSeparator Property string PathSeparator () {get}
PortraitFontNames Property FontNames PortraitFontNames (...
PrintPreview Property bool PrintPreview () {get} {s...
RecentFiles Property RecentFiles RecentFiles () {g...
ScreenUpdating Property bool ScreenUpdating () {get} ...
Selection Property Selection Selection () {get}
ShowVisualBasicEditor Property bool ShowVisualBasicEditor ()...
SpecialMode Property bool SpecialMode () {get}
StartupPath Property string StartupPath () {get} {...
StatusBar Property {get} {set}
System Property System System () {get}
Tasks Property Tasks Tasks () {get}
Templates Property Templates Templates () {get}
Top Property int Top () {get} {set}
UsableHeight Property int UsableHeight () {get}
UsableWidth Property int UsableWidth () {get}
UserAddress Property string UserAddress () {get} {...
UserControl Property bool UserControl () {get}
UserInitials Property string UserInitials () {get} ...
UserName Property string UserName () {get} {set}
VBE Property VBE VBE () {get}
Version Property string Version () {get}
Visible Property bool Visible () {get} {set}
Width Property int Width () {get} {set}
Windows Property Windows Windows () {get}
WindowState Property WdWindowState WindowState () ...
WordBasic Property IDispatch WordBasic () {get}


AMAZING! I could then find the property I wanted and send it the syntax i needed, how cool !

> 1000 Visits

Last night my sometimes working hit counter said I had over 1000 hits, just wanted to say a big thank you to anyone that has bothered to read the ramblings of a lonely IT contractor and a bigger thanks to those of you who have come back again !

Rescan all hosts for new storage

More of a note for myself really but others may find this useful, to rescan all the hosts (rather than clicking Rescan in the GUI) you can run the following PowerShell command:

For a Specific Cluster:

get-cluster -name "MY CLUSTER" | get-vmhost | Get-VMHostStorage -RescanAllHBA

All Hosts in VC:

get-vmhost | Get-VMHostStorage -RescanAllHBA

VI Toolkit Webinar by Carter Shanklin

For those who haven’t had much exposure to the Powershell Toolkit and what it can do, there is a recording of a webinar presented by the Carter Shanklin at this link. It is pretty basic and intended for those with little or no exposure to the toolkit.

If you’ve ever wondered what it is or why you might want to use it (like disconnecting the CD from 45 or 50 VMs so you can VMotion them without having to deal with the right-click – pick-from-the-pop-up-menu process manually 45-50 times) then you might want to check this out.

More recorded webcasts are available on : http://www.vmware.com/a/webcasts/recorded/

Original Source and great site: here

VMworld 2008

For those of you who are not going to VMworld (Everyone I know in the UK) you can keep up to date by using the following blog where they will post the latest news and information....

http://vmworldunderground.ning.com/

Workstation 6.5 RC released

VMware Workstation 6.5 Release Candidate
Latest Version: Release Candidate| 8/18/08 | Build 110068

Now available at:  http://www.vmware.com/communities/content/beta/ws65/welcome.html

VIOPS ready for Vegas

VIOPS has now gone production at http://viops.vmware.com ready for its launch in Vegas.

Check this out, its good stuff.

Exporting Virtual Infrastructure Information to MS Word

The below is a script that will export various information into Microsoft Word using PowerShell and the VI Toolkit, this is completely risk free and does not alter anything, just feed it your VI server name and sit back, it can also be used as a scheduled task and even set to email you a word attachment.

It even throws in a few graphs and pie charts for good measure, almost all information can be sent to the functions for you to expand on the report easily.

Comments are welcome, the good the bad and the ugly !

Usage: report.ps1 YOURVISERVER

See below or download here:

Reporting Script

VIOPS - Virtual Infrastructure Operations

VMware are piloting a new extension to the VMware communities called VIOPS - short for Virtual Infrastructure Operations.

The VMware VI OPS portal is a community-based repository for prescriptive, proven, and actionable guidance for operationalizing VMware in your IT organization. Proven practices provided by VMware and industry experts covering a wide range of operational topics are available in an easy to search, consistent format so finding the information you need is quick and easy.

The pilot site is at http://vpp-dev-1.vmware.com

They are going live with this soon, with the launch due at VMworld.

Already there is some great content and once launched I can only see this getting better.

Getting Started with the VI Toolkit

I have become a big fan of the Virtual Infrastructure (VI) Toolkit over the last month and it has really helped me learn PowerShell which I knew I would have to learn sooner or later but kept putting off.

I would now like to spread the word and help out those of you wondering what the hype is all about by telling you how to get started.

Do I need to install the VI toolkit on the VI server ?

No, Definitely not, this can be installed on your workstation and can be used to hook into the Virtual Infrastructure, nothing additional will need to be loaded onto the VI server.

What you will need

Download the following and install them in order:

  • .Net framework 2.0 (if not already installed)

This is a Next, Next jobbie until completed.

This is also a Next, Next jobbie until completed.

Just to make a change this is a Next Next

That gets the basics but what you also may want to install is the following:

Once these have all been installed you are nearly ready.

From your desktop start the VI toolkit via the newly created shortcut or choose it from the Start Menu if you prefer, once started type the following and press enter:

Set-ExecutionPolicy RemoteSigned

You are now all set to start with PowerShell and the VI toolkit, lets do a simple task just to get you started...

From within the Powershell window now open connect to your Virtual Infrastructure server by using the following command or as you are now using powershell they are know as cmdlets.

Connect-VIServer YourServername

Obviously replace YourServerName with you VI Server.  Once connected you will be able to start issuing commands to the session to retrieve information, try the following simple cmdlet and press enter:

Get-VM

You will now see a list of all Virtual Machines.

And so it begins, this is just a simple cmdlet which will get you hooked from the start, issue the following command to list the other VI Toolkit cmdlets:

Get-VICommand

This should list enough for you to get started, now you can explore PowerShell and the VI Toolkit, for quick examples of what can be done take a look at the VMware examples here:

Managing VMware with PowerShell FAQ

Now there will be no looking back, welcome to the Jedi !

More on the Update 2 Issue

Email received from VMware:

ESX/ESXi 3.5 Update 2

Dear VMware Customers,

Please find the latest update about the product expiration issue. From this point on, we’ll provide an update every two hours. Thanks.

Problem:

An issue has been discovered by many VMware customers and partners with ESX/ESXi 3.5 Update 2 where Virtual Machines fail to power on or VMotion successfully. This problem began to occur on August 12, 2008 for customers that had upgraded to ESX 3.5 Update 2. The problem is caused by a build timeout that was mistakenly left enabled for the release build.

Affected Products:

  • VMware ESX 3.5 Update 2 & ESXi 3.5 Update 2
  • Reports of problems with ESX 3.5 U1 with the following 3.5 Update 2 patch applied.
            1. ESX350-200806201-UG
  • No other VMware products are affected.

What has been done?

  • Product and Web teams pulled the ESX 3.5 Update 2 bits from the download pages last night so no more customers will be able to download the broken build.
  • VMware Engineering teams have isolated the cause of the problem and are working around the clock to deliver updated builds and patches for impacted customers.
  • A Knowledgebase article has been published (http://kb.vmware.com/kb/1006716), but traffic to the knowledgebase is causing time outs. A new static page has been published at http://www.vmware.com/support/esx35u2_supportalert.html that customers and partners will be able to view.
  • The phone system has been updated to advise customers of the problem
  • Vmware partners have been notified of the issue.

Workarounds:

1. Do not install ESX 3.5 U2 if it has been downloaded from VMware’s website or elsewhere prior to August 12, 2008.

2. Set the host time to a date prior to August 12, 2008. This workaround has a number of very serious side affects that could impact product environments. Any Virtual Machines that sync time with the ESX host and serve time sensitive applications would be broken. These include, but are not limited to database servers, mail servers, & domain administration systems.

Next Steps:
VMware to notify customers who have downloaded this version and provide an update every two hours.

Resolution:

VMware Engineering has isolated the root cause and is working to produce an express patch for impacted customers today. The target timeframe is 6pm, August 12, 2008 PST.

FAQ:

1. What would this express patch do?
More information will be provided in subsequent communication updates.

2. Will VMware still reissue the upgrade media and patch bundles in the timeframe that has been communicated?
Yes. We still plan to reissue upgrade media by 6pm, August 13 PST (instead of noon, August 13 PST) and all update patch bundles later in the week. We will provide an ETA for the update patch bundles subsequently. NOTE: the "patch bundles" referred to here are for the patches listed above under "Affected Products" and the other bundles released at GA. They are not the same as the express patch which is targeted for 6pm, August 12, 2008 PST as stated above.

3. Why does VMware plan to reissue the upgrade media before the patch bundles? That is a wrong priority call!
This is not a matter of priority. Since we can get done building and testing the upgrade media before the patch bundles, we want to make that available to customers first instead of reissuing all the binaries later in the week.

4. Can VMware issue a patch that opens the licensing backdoor in the next hour as a critical measure?
There is no licensing backdoor in our code.

5. Does this issue affect VC 2.5 Update 2?
No.

6. What is VMware doing to make sure that the problem won’t happen again?
We are making improvements on all fronts. The product team had endeavored to deliver a release with support customers deem important. But we fell short and we are deeply sorry about all the disruption and inconveniences we have caused. We have identified where the holes are and they will be addressed to restore customers’ confidence.

Don't Upgrade to ESX 3.5 Update 2 just yet

VMWare blogs all around are reporting an issue, see here for more details: http://www.ntpro.nl/blog/archives/584-ESX-3.5-U2-license-expires-on-August-12.html

VI 3.5 in a box

Looks like Xtravirt have updated there popular document explaining how to install VI into a VMWare Workstation VM, this can be found here and is ideal for testing, time to start buying some of the cheap ram !

Powershell: Is Microsoft Word Installed ?

A quick script to check if Microsoft Word is Installed....

if ((dir  REGISTRY::HKEY_CLASSES_ROOT\Word.Application) -eq $Null){
       Write-Host "Microsoft Word not installed"
}
Else
{
       Write-Host "Microsoft Word Detected"
}

Powershell One-Liner's

You gota love Powershell, You gota love VI Toolkit, if you love both then you must know Hal Rottenberg, he has been pumping out some great one-liners as well as his blog and working on his book and also the fantastic powershell podcast, this guys a machine !

Amazing VMWare Links

I'm not sure if I have mentioned vmware-land before, no its not a Michael Jackson type fairytale land its actually an amazing site with the most links I have ever seen to various VMWare subjects, you want to find something... its all here http://vmware-land.com/Vmware_Links.html

VMTN Login Issues ?

I'm trying to login to VMTN and it wont let me, is anyone else having issues today or is it just me, tried a couple of PC's.

Update: Looks like there is an issue as a fellow community friend is also having problems as well as a couple of guys in the US who have been in contact.

Update: 05 Aug 08, 08:30 (GMT) Now Working again.