WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple

ESXi syslog caveat

06.24.2010 by William Lam // 5 Comments

There are two easy methods of capturing logs for both an ESX or ESXi server:

  1. Use VMware vMA and vilogger to setup a syslog server. Simon Long wrote a very detailed article on how to configured and set it all up, check it out here.
  2. Configure ESX or ESXi server to remotely log to an existing syslog server.

In ESXi, there are potentially three sets of logs to be captured: messages, hostd, and vpxa (if your host is being managed by vCenter). If you are using option #1 and you have enabled logging using vilogger, you will see the following:

[Read more...]

Categories // Uncategorized Tags // syslog, vpxa

My VCAP4-DCA beta experience

06.21.2010 by William Lam // 5 Comments

Over the weekend I participated in the VMware VCAP4-DCA beta exam, which is set to release later this year. My exam consisted of 41 live labs and I completed the exam in a little under 4.5 hours. Due to the NDA restriction, I will not be able to go into the specifics of the exam but I can share with you my experience while taking the exam.

The biggest issue I had while taking the exam was the user experience, which for me personally sucked! After 30 minutes or so into the exam, I noticed the display started to overlay multiple images on top of each other and not refreshing properly. Not only did I have interlaced images, certain parts of the screen were blank white and required multiple minimizations to force a redraw of the screen, which did not always work. This was very frustrating to deal with throughout the exam and at one point I had to call the proctor in since I was not able to figure out what I was clicking on as it actually was selecting something else. I ended up moving forward with the exam since I was already half way into the exam and there was nothing more the testing facility could have done. I did have the staff create an incident report which will be submitted to VMware for feedback on the display and connectivity issue.

After the exam ended, I spoke to the proctors and they had mentioned they had a similar issue earlier in the week with another candidate taking a VMware certification. They did not say if it was for VCAP-DCA but did say it was not an issue with Pearson but with the actual labs at VMware where these environments were hosted. If a user paid $400 for this exam and you received the type of experience I had, you would not be a happy camper. VMware still has some work to do in this area before the exam is ready to roll out later this year.

Other than a few minor issues/typos with some of the questions and pristineness of the environment, I was very impressed overall with the exam. I thought that the questions and tasks were very fair, some definitely took much longer to complete than others, so be cautious of your time. I thought I would be able to go back and check on some of the questions I had marked to come back to but ended up running out of time at the end. Luckily, I was able to provide comments on every question, though not in the detail as I would have liked. Looking back at the VCAP-DCA blueprint, I think the certification team did a pretty good job of providing an outline of topics to study for. Though it can be daunting at first glimpse, it definitely will be your best source of reference material. Unfortunately most of the beta invitees had less than 2 weeks if not less to prepare for this exam.

I also concur with Chris Dearden's observations with the blueprint, another beta participant of the VCAP-DCA exam. I felt that the exam was geared more towards consultants and/or outsourcing backgrounds than just VMware administrators. The topics on the blueprint ranged from the core vSphere components such as vCenter, ESX and ESXi but also additional auxiliary components that may not be used in all vSphere environments (e.g. Orchestrator, vSheild Zones, Heartbeat, etc). I have to agree with Chris' comment, it is probably rare that you will find all of VMware's enterprise products implemented in a single production vSphere environment other than maybe a test or development lab. For me, this was the first time I  have implemented some of these systems in my lab while studying for the exam.This was definitely a challenge with unfamiliar technology and a limited amount of time to to prepare for the exam.

Speaking of a lab, I would highty recommend that you setup a test lab as mentioned by Chris. You will probably need a minimum of two hosts to test and setup the various configuration laid out in the blueprint. I was fortunate enough to have access to two physical hosts and deployed 4 vESX(i) (virtual ESX & ESXi) hosts while studying for the exam.

In terms of advice, I would say to make sure you go through the blueprint thoroughly and make sure you can perform all the skills and abilities listed in each of the objectives. It is also very important to be able to perform the tasks using both the CLI and the GUI, making sure you are comfortable with both.

All in all, I was pretty happy with the exam minus the user experience. I will probably be a wreck until the results are announced (4-6 weeks maybe?) and hopefully I will pass. In the meantime, I will be able to get back to some of the scripts that I have put on hold while studying for this exam!

Good luck to anyone that may be taking the exam on the last day of the beta program which ends on Monday June 21st, 2010. I think the VMware community will be very happy with the new VCAP-DCA certification when it is released!

Update 10/14 - I just received an email that I passed VCAP4-DCA beta exam! I'm glad the wait finally over

Update 12/15 - I just received an email on my VCAP4-DCA number, I am VCAP4-DCA #6

Categories // Uncategorized Tags // dca, vcap

esxcli Part3 - Automating esxcli using PowerShell

06.18.2010 by William Lam // Leave a Comment

In this final three part esxcli series, I will show you how to automate esxcli operations in a Windows environment using PowerShell. There was a recent question on the VMTN forums regarding this very topic. As a simple solution to the problem, a community member provided a snippet of PowerShell code. Of course the snippet of PowerShell code originated from the great PowerCLI Master - Luc Dekens.

I have slightly modified the original version of the script as I am not a fan of hard coding passwords within a script. This version of the script requires plink which is a command-line interface to the free Windows SSH PuTTY back end. The script performs an SSH connection to either an ESX or ESXi host to run esxcli command locally, with the specified parameters as you would if you were on the Service Console, or the unsupported Busybox console.

Copy the snippet of code below and create a new script called esxcli-automation1.ps1 and replace all the variables matching your environment including the $cmd which specifies the exact esxcli command you are running on the remote host.

esxcli-automation1.ps1

$User = "root"
$Computer = "esxi4-1.primp-industries.com"

#prompt user for password
$passwordInput = Read-Host -AsSecureString:$true "Please enter password for $Computer"

#convert secure password to normal string
$Ptr = [System.Runtime.InteropServices.Marshal]::SecureStringToCoTaskMemUnicode($passwordInput)
$Password = [System.Runtime.InteropServices.Marshal]::PtrToStringUni($Ptr)
[System.Runtime.InteropServices.Marshal]::ZeroFreeCoTaskMemUnicode($Ptr)

$plink = "C:\plink.exe"
$esxcli = "esxcli"
$plinkoptions = " -v -batch -pw '$Password'"
$cmd = 'nmp device list'
$remoteCommand = $esxcli + " " + '"' + $cmd + '"'
$command = $plink + " " + $plinkoptions + " " + $User + "@" + $computer + " " + $remoteCommand
Invoke-Expression -command $command

Here is a sample execution listing devices:

There are a few issues with this script:

  • Assumes SSH connectivity is open to the host, which on classic ESX w/Service Console is probably a valid reason but what about ESXi? We know that we should not be using the unsupported Busybox console on ESXi and we can not make the assumption that it will be opened
          Here is the same example when executing against an ESXi host:

  • The script can only execute against one host at a time.

In a perfect world, the esxcli API would be properly exposed and integrated into the vSphere API. PowerCLI and other vSphere SDKs would be able to automate these configurations without this hack, but unfortunately this is not the case. However, we can leverage the esxcli utility that is bundled up with the vCLI which can be installed on either a Linux or Windows platform.

With this information, I decided to write my own PowerShell script (yes you heard right, it was slightly difficult without knowing the syntax and format) matching the capabilities similar to that of the vSphere SDK for Perl implementation running on vMA. So here is the second revision of the script called esxcli-automation2.ps1:

esxcli-automation2.ps1

$Username = "root"
$esxcli = "C:\Program Files\VMware\VMware vSphere CLI\bin\esxcli.exe"
#$Params = "swiscsi nic list -d vmhba33"

#list of ESX and ESXi host to perform operation against
$vihosts = @("esxi4-1.primp-industries.com","esxi4-3.primp-industries.com")

#prompt user for password
$passwordInput = Read-Host -AsSecureString:$true "Please enter your common password for hosts"

#convert secure password to normal string
$Ptr = [System.Runtime.InteropServices.Marshal]::SecureStringToCoTaskMemUnicode($passwordInput)
$Password = [System.Runtime.InteropServices.Marshal]::PtrToStringUni($Ptr)
[System.Runtime.InteropServices.Marshal]::ZeroFreeCoTaskMemUnicode($Ptr)

#loop through array of hosts
for($i = 0; $i -le $vihosts.length -1; $i++) {
 write-Host Executing operation on $vihosts[$i]
 #could not find a way to store the params in a variable you must
 #insert esxcli parameters at the very end of the statement below
 & $esxcli --server $vihosts[$i] --username $Username --password $Password swiscsi nic list -d vmhba33
}

Note: PowerCLI is not required, just PowerShell.

This new version of the script allows you specify a list of ESX or ESXi host to perform a common esxcli operation. The script also prompts for the password as the previous script, so you do not have to hard code the password to the host. You will need to update the script with the path to the plink.exe and the list of hosts you want to perform the operation against.

Here is an example of verifying iSCSI multipathing configuration against two hosts (1 ESX and 1 ESXi) without the use of SSH:

As you can see, you can easily integrate this with other existing PowerCLI scripts that perform configuration changes across a given set of host(s). Until VMware provides access to the esxcli APIs, these are some of the methods/hacks that need to be implemented when automating configuration changes using esxcli.

Here are some PowerShell references that were used in creating the two scripts:

  • http://technet.microsoft.com/en-us/library/ee176935.aspx
  • http://www.rickcable.com/blog/default.asp?Display=33
  • http://bsonposh.com/archives/247

Categories // Uncategorized Tags // api, ESX 4.0, esxcli, vSphere

  • « Previous Page
  • 1
  • …
  • 552
  • 553
  • 554
  • 555
  • 556
  • …
  • 560
  • Next Page »

Search

Thank Author

Author

William is Distinguished Platform Engineering Architect in the VMware Cloud Foundation (VCF) Division at Broadcom. His primary focus is helping customers and partners build, run and operate a modern Private Cloud using the VMware Cloud Foundation (VCF) platform.

Connect

  • Bluesky
  • Email
  • GitHub
  • LinkedIn
  • Mastodon
  • Reddit
  • RSS
  • Twitter
  • Vimeo

Recent

  • Programmatically accessing the Broadcom Compatibility Guide (BCG) 05/06/2025
  • Quick Tip - Validating Broadcom Download Token  05/01/2025
  • Supported chipsets for the USB Network Native Driver for ESXi Fling 04/23/2025
  • vCenter Identity Federation with Authelia 04/16/2025
  • vCenter Server Identity Federation with Kanidm 04/10/2025

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2025