Sunday, January 22, 2012

Unable to connect to vcenter inventory service...

You will face above issue If the actual host name or domain name of the vCenter Server machine does not match the name that was entered at installation, the service does not work. When the host name or domain name of the vCenter Server machine changes after you install vCenter Server, update the configuration information of the inventory service. by restarting vCenter Inventory Service

After restarting vcenter Inventory Service

You might face another issues as well if you dont fulfill below requirement while installation as metioned in my earlier blog


Installation Vsphere Web Client (Server)

One of the new and cool features in VMware vSphere 5.0 is vSphere web client (server), which is provided in vSphere 5.0 media. It allows you to use different type of internet browsers and operating systems to connect to vsphere 5.0 servers, Sit anywhere in your office on any PC which give the freedom that you don’t need to install vpshere client (if that pc doesn’t have installed), vsphere web client is also best for VPN use.

Only limitations with vSphere Web client is plug-ins such as Update Manager, SRM etc. Currently you can’t add new datacenters and add new host or folders to it, No maps view and other some of the features, however other functionality are available monitoring, VM administration etc, to read more on this I will suggest you to check 

I personally think there is a possibility as time will go vSphere web client will become more mature and replace vsphere client in future eventually.

Vsphere web client (server ) software requirement
The following browsers are supported for the vSphere Web Client:
Microsoft Internet Explorer 7 and 8
Mozilla Firefox 3.6 or later

The vSphere Web Client requires the Adobe Flash Player version 10.1.0 or later to be installed with the appropriate plug-in for your browser.

You can install vcenter web client (server), either on vCenter server or any other server with connectivity to vcenter server, here I am installing it on vcenter server.
Insert vsphere5.0 vcneter media, Media will autorun or you can go to media and run installer manually if it doesn't autorun.

Select Vmware vSphere web client (server) and press install, Once you install it with default settings.
Now if you directly try to open vsphere web client in browser you will get below error. Need to register vcenter server in vcenter web client.
On the server Go to Start>>Vmware vSphere webclinet>>vSphere Administration Application or open below link in web browser to configure (register vcenter server in web client(server))

(Localhost is where you have installed vsphere web client)

Click register vcenter vCenter Server as below screenshot.
In next screen provide information like vcenter servername or IP and administrator username and password. and web client server name or IP where you have install we client server, in my case I have installed web client server on vcenter server. 

After providing information and clicking register it will start registering. Make sure all your DNS entries are configured currect (Reverse DNS also).

You get successfully connected to vcenter server, which show certificate warning, you can check install this certificate box and ignore it. so it won't bug you next time. (if you have configured Certificate Authority you can use the same).
Next screen shows your have successfully registered vCenter server.

Now its time to check web client. Open below link in supported browsers

 Install below activex which is published by vmware for better enhanced experience.
Choose server where you want to log in, enter vcenter server credentials,  and you are done, press login.
 Firsts screen after login.

Saturday, January 14, 2012

Reset IBM IMM (Integrated Management Module) also called IBM RSA

Useful links: 
Find iLo, Drac, IMM/RSA, CIMC IP and MacAddress on esxi (vCenter)
Reset the remote console (DRAC/ILO/RSA)
You might have faced issue with IBM IMM (Integrated Management Module) also called IBM RSA that IP address or IMM name (simmilar to host name) is pinging but you are not able to open webpage. It is painful in the situation when you want to perform reboot, any firmware upgrade, to check server os status from remote location, To sort out you need to reset (restart) IBM IMM not server.
follow below steps to reset IBM.

Open command prompt (you can use putty as well, here I will demostrate with Microsoft command prompt)
Start >> run >> cmd

Type Telnet appending by your IBM IMM IP address or IMM name press enter.
Telnet IMM_name

Enter user login (userID) and password.
Now on next screen type resetsp and press enter  to reboot IBM IMM as below screenshot.

It will loose connection for 1 or 2 min.

Open IBM IMM ip in web browser, and its done.

Friday, January 6, 2012

Powershell -- Enable/disable LAN card

$network = get-wmiobject win32_networkadapter | where-object {$_.netconnectionID -like "*IBM USB*"}
$network.disable() ##use enable() to enable card.

How did I find above script.

Above script is not much great, anyone can find it, but here I am posting it for beginners, who have some foundation knowledge but don't know where to begin, so here are some of the pointers. I even posted how I went wrong and how I corrected myself. 

Here i go.
Gets instances of Windows Management Instrumentation (WMI) classes or information about the available classes

I usually use Get-WmiObject to query hardware information, after putting series of below wrong command,
c:\get-wmiobject | where-object {$ -like "*network*"}
c:\get-wmiobject list | where-object {$ -like "*network*"}

Got my mistake where I am wrong and ran below command. which gave me huge list of classes (objects)
c:\>get-wmiobject –list
c:\>get-wmiobject -list | where-object {$ -like "*network*"} #To find only network related classes/objects

Tried first object, win32_networkadapter (I thought this will be the same object as I want, where I can find network adapter information) and ran   
c:\>get-wmiobject win32_networkadapter

Ran series of command to find network adapter name “IBM USB”  but no success.
c:\>get-wmiobject win32_networkadapter | ft –auto
c:\>get-wmiobject win32_networkadapter | where-object {$ -like "*IBM USB*"} # * used as a wild card

Ran get-member to list properties and method for win32_networkadapter class.
c:\>get-wmiobject win32_networkadapter | get-member

But still I was not sure where can I find property containing “IBM USB” and tried some of the properties
c:\>get-wmiobject win32_networkadapter | ft name
c:\>get-wmiobject win32_networkadapter | ft systemname

I got an idea, and exported all the properties in csv file, after lots of spelling mistakes and wrong commands I successfully captured data.
c:\>get-wmiobject win32_networkadapter | ft * | exprot-csv -path test.csv # Spelling mistakes (exprot-csv)
c:\>get-wmiobject win32_networkadapter | ft * | export-csv -path test.csv # Ft command not needed here
c:\>get-wmiobject win32_networkadapter | export-csv -path test.csv #success

I opened test.csv file and found NetconnectionID is the property where I can find desired network adapter (This is the only column contains "IBM USB"), again did some more mistakes, and I was getting either null data or errors.
c:\>get-wmiobject win32_networkadapter | where-object {$_.netconnectID -like "*IBM USB*"}
c:\>get-wmiobject win32_networkadapter | where-object {$_.netconnectID -match "*IBM USB*"}
c:\>get-wmiobject win32_networkadapter | where-object {$_.netconnectID -match "*IBM USB*"} # spelling mistake ($_.netconnectID)

Ran below corrected command and compared Macaddress from powershell console and network adapter GUI, both were same.
c:\>get-wmiobject win32_networkadapter | where-object {$_.netconnectionID -like "*IBM USB*"} 

To find out how to enable or disable this network card ran get-member.
c:\>get-wmiobject win32_networkadapter | where-object {$_.netconnectionID -like "*IBM USB*"} | get-member

 Final Script as below, saved networkadapter details in variable called "nic" then tried it with Disable() to check and it worked, to enable card use enable() method. once you enable or disable verify it from network connections in control panel.

c:\> $nic = get-wmiobject win32_networkadapter | where-object {$_.netconnectionID -like "*IBM USB*"}

When running this script open network connections and you can check results.

***Have a nice scripting***


Sunday, January 1, 2012

Export get-member data to csv file

Each time I was running get-member to get properties or method i was getting huge list, and searching through required property or method or reading definition was a headache in Powershell console.    
If you export all data to CSV it is convenient to make note and preserve your findings, command in CSV files.

$process = get-process
$properties= $process | get-member
$properties | export-csv -path c:\scripts\test1.csv

Earlier I was running below script to get data exported to CSV file, but every time I required to format data (Open CSV; copy all contents to notepad, then rename notepad extension .txt to .csv)

#Open test.csv; copy all contents to notepad, then rename notepad extension .txt to .csv
$process = get-process
$properties= $process | get-member
foreach ($prop in $properties) {$final += “`n” + $ + ", " + $prop.membertype + ", " +  $prop.definition}
$final | out-file c:\scripts\test.csv

It seems that when I extract data from $properties ($prop) it goes into string format. I am trying to figure it out. Once I get solution I will post it.
Currenlty I am reading Master-PowerShell | With Dr. Tobias Weltner, Free to download as a PDF. It is really a great source to self study.