Archive for category Scripts
Here’s a Nice Holiday Present from William Lam and Tuan Duong
Posted by Chris in Desktop Virtualization, Scripts, Server Virtualization, VMware on December 19th, 2008
There’s no better way to spread some holiday cheer than sharing some custom virtualization management scripts. Just in time for the holiday’s, William Lam and Tuan Duong have shared a number of treasures (each makes a perfect gift). In fact, I think I’ll print some of their latest scripts and put them in the Christmas cards I’ll be handing out to family members. I can just picture the look of disbelief on my Uncle Jimmy’s face as he looks at a linked clone creation script on Christmas morning.
All kidding aside, I recommend that you set aside some time during the last minute holiday rush and check out the script treasure trove that William and Tuan are putting together. I’ve found their linked cloning scripts to be very helpful to some of my current work, and their growing list of undocumented ESX and ESXi commands is useful too. You’ll also want to check out their linked clone implementation details on the VMware communities site.
Also, if any of you are seeing some really good results with scaling linked clones, please let me know. I’m very interested in how far we can push the scalability envelope.
PXE Booting a Stateless ESXi Hypervisor and a Glimpse of the Future
Posted by Chris in Scripts, VMware, Virtualization Management on August 9th, 2008
For the past couple weeks, I have had the pleasure of working closely with VMware Corporate Architect Lance Berc while testing his ESXi hypervisor PXE boot solution. There’s been plenty of good solutions for PXE installing the ESX hypervisor. In fact, Mike Laverick has written a great how-to on the subject. However, when it comes to PXE booting and configuring ESXi, so far we have been left in anticipation.
There are plenty of advantages to PXE booting a hypervisor, including:
- Rapid hypervisor deployment to nearly any server
- Rapid hypervisor updates – a hypervisor’s VMs can be live migrated (e.g. VMotion) to a new server and their original host rebooted to receive an update
- Servers can be deployed without any internal hard disks, making them more energy efficient (the PXE-booted hypervisor would run in physical RAM, removing the need for a physical hard disk)
Virtual Iron realized the benefits of this concept a long time ago and has offered PXE boot support of their Xen hypervisor implementation for years. Considering ESXi’s small size (32MB), offering a PXE boot option for ESXi makes a lot of sense. Some ESX gurus have been working on solving the ESX PXE boot riddle for quite some time (see Vinternals’ PXE Boot ESX 3i Installable Edition for more details). However, it was VMware’s Lance Berc that was able to develop a fully working proof of concept that includes deploying a new ESXi hypervisor and configuring all necessary settings (e.g. storage, vSwitches and physical NICs, cluster association). I’ve had the opportunity to test and validate Lance’s solution in my lab, and with his permission, I’m able to disclose a rough outline of the details. It’s my hope that by disclosing the VMware proof-of-concept that enough interest will be generated to propel PXE booting ESXi as a future product feature.
Now let’s get on to the details. For starters, you’re going to need a PXE server, and each ESXi server will need network interfaces and a system BIOS that supports PXE/network boot. If you have a system so old that it doesn’t support these features, then it’s probably not a good candidate to run ESXi anyway.
In addition to the PXE server, you will also need:
- VMware ESXi boot and image files extracted from the ESXi installable CD (binmod.tgz, environ.tgz, cim.tgz, oem.tgz)
- A Virtual Center server
- A PXE boot midwife
- Microsoft PowerShell (installed on the VC server)
- VMware PowerShell toolkit
- VMware SDK Perl toolkit
- lance.tgz
- Midwife scripts (download Lance’s samples here)
Lance’s PXEextract document does a nice job detailing the steps needed to extract the ESXi boot and image files from the ESXi installation CD or .iso image. The PXE boot midwife runs the scripts necessary to remotely configure the PXE booted ESXi server; in essence, it assists in the birth of the server. Here is Lance Berc’s description of the midwife’s role:
Introducing the new machine to the environment has several steps:
- Boot ESXi via DHCP/PXE, passing the address of the midwife
- After initialization the new system sends a birth message to the midwife
- The midwife cleans residual state from Virtual Center
- The midwife uses Virtual Center to configure the new system
We have built a prototype midwife out of scripts utilizing the VMware VI3 SDK. There are two sets of scripts, one in Perl and the other in PowerShell. This is very raw code and has not been made robust.
Microsoft PowerShell, the VMware PowerShell toolkit, and the VMware SDK Perl toolkit had to be installed on the VC server (also the midwife) in order to run the midwife scripts. lance.tgz contains a few files that I’ll let remain nameless. As you can suspect, that package is needed to get the stateless configuration to fully run.
Once you have everything in place, deploying a new ESXi host is a piece of cake. In my lab, I was able to automatically configure an ESXi box and join it to an existing VC cluster. Thus far, I’ve booted stateless ESXi hosts with both NFS and iSCSI storage without a hitch, and plan to test a PXE boot ESXi box with Fibre Channel storage in the coming weeks.
PXE booting ESXi opens numerous hypervisor management and deployment possibilities that previously didn’t exist. If this is a feature you would like to see in a future VMware release, please let me know via a comment to this blog. Let’s consider this a virtual petition for requesting a necessary new feature in VMware Virtual Infrastructure deployment and management.
I’m guessing that some of you may want to be able to test this solution in some capacity as soon as it is available. If that sounds like you, keep your eye on Lance Berc’s posts in the VMware forums.
Have You Gotten Your Copy Yet?
Posted by Chris in Backup & Recovery, Performance, Scripts, Security, Server Virtualization, Storage, Troubleshooting, VMware, Virtualization Management on August 6th, 2008
Last week while speaking at TechTarget’s Advanced Enterprise Virtualization seminar, I was asked a question I get quite often – “What book do you recommend if we want to learn more?” The answer to that was easy. The audience consisted pretty much of senior level administrators who were either running or planned to deploy VMware-based virtual environments, so I asked if everyone had purchased a copy of the VMware Infrastructure 3 Advanced Technical Design & Advanced Operations Guide. The attendees were surprised that I didn’t mention my own book, but why should I? My virtualization book was published in 2005, so it’s a dinosaur in terms of virtualization books. Even back then, I wrote a good virtualization book that covered many platforms, but at the time the best book for ESX environments was the VMware ESX Server: Advanced Technical Design Guide. I’m out of the book writing business, so I’ll point people to articles I’ve written and my free virtualization overview published by Burton Group in 2007, Let’s Get Virtual: A Look at Today’s Server Virtualization Architectures. When it comes to books, I’d rather have people spend their money wisely on what I feel are the best ones out there.
I had pre-ordered the VMware Infrastructure 3 Advanced Technical Design and Operations Guide and received my copy from Amazon a few days before my seminar last week. If you’re thinking about deploying VMware or are already running VMware Virtual Infrastructure, I consider this book to be a requirement. The authors, Ron Oglesby, Scott Herold, and Mike Laverick are three of the foremost VMware experts in the world. Together, they delivered a highly comprehensive book that takes you from planning and architecture to operations and advanced management. Let’s face it, you can find a lot of information online today, so to me the value of a good book is in the information that goes beyond what is already there in a vendor’s how-to guide. This book certainly does not disappoint. Of course, some of the book’s content is online, like Mike Laverick’s excellent how-to on PXE installing ESX, but that’s no reason to forgo this treasure. There’s a lot to say about having all of your go-to information in one place, and this book is it.
The book weighs in at over 800 pages, and unlike other technical books, size does not equal fluff. The authors are very to-the-point and clear in their explanations, and I’m sure likely struggled with having to draw the line on content. The size is also due to the fact that it is two books (Advanced Technical Design Guide and Advanced Operations Guide) packaged as one. By packaging this way, you’re saving money. I wanted to name my favorite chapter, but found this impossible, because all of the chapters contain excellent information. That being said, here’s a list of my personal favorites:
Advanced Technical Design Guide
- Chapter 4 – Virtual Center and Cluster Design
- Chapter 5 – Storage
- Chapter 6 – Networking Concepts and Strategies
- Chapter 7 – VMs and VM Selection
- Chapter 8 – Managing the Environment
- Chapter 10 – Recovery and Business Continuity
Advanced Operations Guide
- Chapter 2 – Networking
- Chapter 3 – Storage
- Chapter 10 – VMotion, DRS, and HA
- Chapter 11 – Backup and VMware Consolidated Backup
- Chapter 12 – ESX Command Line Configuration
Each chapter is loaded with tips, tricks, and gotchas founded on real experience. In fact, many of the gotchas that I’ve run into myself were right there in print, and the authors highlighted a few that I have yet to see. You’ll find that having this book is like having an extra VMware consultant on staff. It’s that good.
So if you haven’t bought the VMware Infrastructure 3 Advanced Technical Design & Advanced Operations Guide yet, it’s time. Even if your department doesn’t have the $37.77 that the book is currently selling for on Amazon.com, just ask your worst dressed IT guy to stand outside the building with a cup. I’m sure he’ll have the money in a couple of hours. Bottom line – this book is a must-have for any IT pro responsible for designing, deploying, or managing VMware environments.
New Article Series – Leveraging Active Directory to Track VMs
Posted by Chris in Scripts, Server Virtualization on July 18th, 2007
I recently put together three articles on customizing Active Directory to identify and track physical and virtual computer objects. In the series, I describe how to use and query a computer object’s Description attribute to identify VMs and also how to extend the schema to add two custom virtualization-specific attributes. Here are the links to the articles:
- How to use Active Directory to identify and track virtual machines – Part I
- How to use Active Directory to identify and track virtual machines – Part II
- How to use Active Directory to identify and track virtual machines – Part III
Feedback on the articles or my scripts is always welcome. Thanks!
Rogue VM Detection/VM Inventory Scripts
Posted by Chris in Scripts, Server Virtualization, Storage on May 1st, 2007
Many Windows administrators are starting to struggle with keeping track of virtual machines on their networks. In response to a question for my Tech Line column, I put together two scripts for auditing file systems to locate virtual hard disk files. One of the scripts will audit a single system, while the other will audit an entire domain. To see the scripts, please take a look at my article Inventorying Virtual Hard Disk Files on a Server or Domain.
Migrating VMware Virtual Machines to MS Virtual Server
Posted by Chris in ESX, Scripts, Server Virtualization, Virtual Server 2005 on January 22nd, 2007
The greatest challenge in VM migration is the differences in hardware emulation between VMware and Microsoft. In a series of articles, I lay out how to prep a VM for conversion to the VHD format and then describe how to perform the conversion.
You can migrate a VMDK to a VHD by following the procedures in these two articles:
Migrating VMware Virtual Machines to MS Virtual Server
An Inheritance You can Do Without
Posted by Chris in Scripts, Troubleshooting on January 9th, 2007
Here’s a tip I wrote in my Tech Line column on how to audit and also enable permissions inheritance on AD user objects — An Inheritance You can Do Without.
Easy Local Group Membership Enumeration
Posted by Chris in Scripts, Troubleshooting on November 14th, 2006
Need to know who are members of each local administrator’s group? Here’s a script that can help.
Backing Up and Recovering VMs – Virtualization Book Excerpt
Posted by Chris in Backup & Recovery, Microsoft, Scripts, Server Virtualization, VMware, Virtual Server 2005 on June 1st, 2006
Apress, publisher of my book “Virtualization: From the Desktop to the Enterprise,” recently released a few chapters to the editors at SearchServerVirtualization.com. Here’s the chapter excerpt for VM Backup and Recovery.
Virtual Server Backup Remix
Posted by Chris in Backup & Recovery, Microsoft, Scripts, Server Virtualization, Virtual Server 2005 on February 14th, 2006
Here’s a script I wrote for my Tech Line column to back up MS Virtual Server VMs – Virtual Server Backup Remix







Recent Comments