Friday, January 31, 2014

Dell DRAC: RAC0218: The maximum number of user sessions is reached

Recently, I've received this error several times while deploying servers.  I've found the quickest way to resolve this issue is to SSH into the DRAC and run the following command.  Of course, after confirming that no one is legitimately logged in ;-)

racadm racreset

This command restarts the DRAC and frees up all of the available sessions.

Wednesday, January 15, 2014

Virtu-Al.net vCheck Setup Process


***Mar 16th 2017 - Please see the following post regarding updated instructions on running vCheck as a Scheduled Task:

http://kenumemoto.blogspot.com/2017/03/how-to-schedule-vcheck-report.html

What took me so long to find this Gem of a Tool?!!?

vCheck is a PowerShell Script used to gather critical information regarding your VMware infrastructure.  The beauty of this script is that can be scheduled and configured to send you an email with the output.  

I no longer have to manually run PowerCLI scripts to find Open Snapshots, Datastore info etc.  It's automatically generated and emailed to me before my workday begins.

Below are the steps I took to get vCheck version 6.15  up and running in my environment:


Important Links:

Prerequisites:
PowerShell v2
PowerCLI 5.01 or later
vCenter 2.5 or Later
I created a vCheck account in AD with Read-Only Access to our vCenter server.

Initial Setup:
1. Download a copy of the latest version of vCheck from the following location:
https://github.com/alanrenouf/vCheck-vSphere

2.  Unblock the downloaded zip file.

3. Extract the Zip files to the appropriate folder. 

4. Drill down to the Plugins folder.  Each Plugin is a PS script which gathers information on a specific piece of the virtual infrastructure. 

I created a folder called "Excluded" and moved the plugins I didn't want to run into it.  Depending on your environment, some of these plugins may take hours to run.  (ex. "Find VMs in uncontrolled snapshot mode.ps1")
5. Launch vSphere PowerCLI as an administrator.  I then used the connect-viserver cmdlet to connect to our vCenter server using the account with Read-Only permissions. Run the vCheck.ps1 script:

6. Go through the configuration wizard and enter the appropriate information:

7.  During the configuration process, you may need to supply admin credentials to your vCenter server.  (ex. if the "vcenter services" plugin is selected) The credential information is stored in the Windowscreds.xml file (Encrypted).

 8.  After populating all the required information, the script will run and provide you with a report. 

Scheduling:
1.  In my example, I'm running vCheck on a Server running Windows Server 2008 R2 Datacenter Edition.   In Task Scheduler, I created a task with the following properties:
Program/Script:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

Add Arguments:
-PSConsoleFile "C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\vim.psc1" -file "D:\Scripts\vCheck.ps1" -noninteractive

The vCheck account with Read-Only permissions was used to run the task.

Additional Info:
1.  I received the following error when trying to schedule the job:
Windows PowerShell console file "C:\ Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\vim.psc1" extension is not psc1. Windows PowerShell Console file extension must be psc1.

Resolve by confirming the location and use of Quotation Marks.

2.  virtu-al.net uses the following path when scheduling the job:
“C:\Program Files\VMware\Infrastructure\vSphere PowerCLI\vim.psc1″

However, in my instance, the vim.psc1 file was located in the following location:
"C:\ Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\vim.psc1"

3. Additional email recipients can be added by using a "," between the email addresses.
ex. "user1@domain.com","user2@domain.com"

4. To rerun the setup process, run the following:

5. Job details can also be modified using the "GlobalVariables" file.

6. In my environment, I created 2 jobs.  One is run daily, and contains critical information.  The second one is run one a week (Saturday) and contains plugins that are not as critical, and take an enormous amount of time to run.


Thanks Alan Renouf!