Archive

Archive for November, 2013

vSphere Support Bundle: How to Collect Anything You Want From ESXi, Not Just Logs

November 25th, 2013 No comments

vSphere Client and vSphere Web Client allow administrators to download system logs from different ESXi hosts with choices of predefined groups of information like System, Storage, Network, UserWorld, etc. Under each group, there could be multiple types. For example, under the UserWorld, there are HostAgent and ProcessInformation.

Categories: Virtualization Tags: , , ,

Hacking ESXi For SSH Login Without Password

November 22nd, 2013 4 comments

As a powerful virtualization server, ESXi has a built-in SSH server even though it’s not enabled by default. That is what most system adminstrators use to remotely run commands there. ESXi also has a built-in SSH client so that you can ssh to other servers from ESXi. To use SSH as either server or client, you need to open up firewall. You can use vSphere Client to do it ( on host’s Configuration tab, check out the Security Profile in Software section), or simple with command line as follows.

Categories: Virtualization Tags: , ,

Hacking VMware Private Python API for vSphere with a Quick Sample

November 21st, 2013 7 comments

It’s not a secret that VMware has a private Python API or so called Python binding for vSphere API. If you haven’t heard about it before, no worry. Here is a link to Hostd General Architecture. Somehow it’s not publicly released as a product for customers or partners. Over the years, I only heard a big bank uses it for internal IT automation. But it’s super easy to get it if you want – it’s part of every ESXi installation. Just check it out at /lib/python26-visor.zip if you SSH to your ESXi box. Update: in ESXi 5.5, look at the /lib/python2.6/site-packages.

Categories: vSphere API Tags: , ,

Dummy Virtual Machine For Dummies: How To Create Hundreds of Them with Several Lines of Scripts

November 20th, 2013 No comments

As I introduced in the article on vim-cmd commands, you can use a very simple command as follows to create a new virtual machine. Alternatively, you can ignore the path after the datastore and provide only datastore name (The [ and ] are still needed).

# vim-cmd vmsvc/createdummyvm testVM “[datastore1] testVM/testVM.vmx"

Other than the name and configuration file path in data store, there is no additional information provided such as the size of the disk, memory capacity, etc. Normally, you have to go through a wizard of several pages to create a new virtual machine.

Building Linux Virtual Machine Templates: Tips and Checklist

November 18th, 2013 2 comments

While preparing for my home lab, I have created several virtual machine templates. Here are a few tips I found useful to smoothen the process and make your virtual machine templates easy to be deployed than otherwise.

Install VMware Tools
As you may have known, VMware Tools brings many features to the table, for example,

Significantly faster graphics performance and Windows Aero on operating systems that support Aero
Copying and pasting text, graphics, and files between the virtual machine and the host or client desktop
Improved mouse performance
Synchronization of the clock in the virtual machine with the clock on the host or client desktop
Scripting that helps automate guest operating system operations

Wait, it does not even mention APIs. For Guest APIs in vSphere 5.0 and later to work, you must have VMware Tools installed in your virtual machines.

Agent VM, ESX Agent Manager API, and vijava Support

November 17th, 2013 1 comment

To understand the ESX Agent Manager API, we have to first explain the Agent, which is essentially Agent Virtual Machine. The agent virtual machine can be hardware drivers for your ESXi server, or simply software, i.e, virus scan, that should be deployed on each ESXi. They could have been designed and installed directly on ESXi via VIB, but it would increase the risk of destablizing ESXi due to access to lower level APIs of ESXi. To lower the risk, the driver VM idea came up – if the driver VM crashes the ESXi is still solid even though some service may be affected.

SSH in Python: A Quick Working Sample

November 14th, 2013 4 comments

In one of my recent consulting projects, I had to use SSH from Python. After a little research, I ended up with using the paramiko package as library.

Installing Libraries

To download the paramiko package, just check out this link. What I downloaded was paramiko-1.12.0.tar.gz. After it’s uncompressed with 7-Zip to a temparary directory, just issue the following command and the needed library got installed into the site-packages directory.

e8f7d614cba0bb513c003d214a74722e018

VMware ESXi vim-cmd Command: A Quick Tutorial

November 11th, 2013 24 comments

Command lines are very important for system administrors when it comes to automation. Although GUIs are more likely (not always as I’ve seen too many bad ones) to be more intuitive and easier to get started with, sooner or later administrators will use command lines more for better productivity. Check out DoubleCloud ICE if you want the best of both GUI and command lines.

Categories: Virtualization Tags: , , ,

Tools That Enhance PuTTY Experience

November 3rd, 2013 1 comment

PuTTY is a very popular tool on Windows for connecting to remote server using SSH. As I used it a lot recently, I tried several tools that enhance the user experience. You may be interested in them too.

Desert Color Theme to Better Highlight Information

My experience with PuTTY has been pretty good except that the default color scheme does not highlight key information well, for example, the dark blue color for directory names on black background makes it hard for my eyes.

Categories: Applications & Tools Tags: ,