A. Mikkelsen VMware ESX scripts, commands, tools and other nice to know things that will make your virtualization days easier!!!!

Wednesday, June 25, 2008

Listing DRS VMotion info from VC database

Filed under: ESXi,Tools,Virtual Center,vSphere (ESX) — A. Mikkelsen @ 22:16 pm

Ever wanted to see how many DRS VMotion your ESX enviroment is generating?

Using the following query you can extract the requried information from the VC database.

SELECT vpx_event.event_type, vpx_event.vm_name, vpx_event.create_time
from vpx_event where event_type like ‘%migrate%’

(Thanks to: Dave.Mishchenko

Also see http://www.gabesvirtualworld.com/?p=69 for an idear to what you can do with the information in Excel.

Wednesday, May 21, 2008

Troubleshooting VMware snapshots

Eric Siebert has writen a very good and explaining guide on how to troubleshoot snapshots on ESX 3.x.

Virtualization administrators can use snapshots on VMware ESX to travel back in time and figure out what went wrong with their virtual machines (VMs). But what do you do when your snapshots start acting funny? In this tip, we’ll troubleshoot potential problems that may come up when using snapshots on ESX.

Read it here or read my local copy.

Thursday, May 15, 2008

Upgrading to ESX 3.5.x and VC 2.5.x – Read this guide

Filed under: ESX Migrate/Upgrade,Virtual Center,vSphere (ESX),White Papers — A. Mikkelsen @ 12:56 pm

Looking for a guide to upgrade your VMware ESX enviroment to ESX 3.5 and VC 2.5, then this guide from RTFM Education is a must read.


Friday, April 11, 2008

Quick rename of VM

Filed under: ESXi,Virtual Center,vSphere (ESX) — A. Mikkelsen @ 13:50 pm

Duncan over at YelloBricks.com posted a nice easy howto on renaming a VM from within VC and from the service console.

There are a couple of ways to rename a Virtual Machine, but there are two in my opinion that stand out:

  1. Shutdown the VM
  2. Rename the VM in VirtualCenter
  3. Migrate the VM and move it to another Datastore
  4. done!

And from the service console:

  1. vmware-cmd -s unregister /vmfs/volumes/datastore/vm/vmold.vmx
  2. mv /vmfs/volumes/datastore/vm-old /vmfs/volumes/datastore/vm-new
  3. cd /vmfs/volumes/datastore/vm-new
  4. vmkfstools -E vm-old.vmdk vm-new.vmdk
  5. find . -name ‘*.vmx*’ -print -exec sed -e ’s/vm-old/vm-new/g’ {} \;
  6. mv vm-old.vmx vm-new.vmx
    for every file that hasn’t been renamed (.vmsd etc.)
  7. vmware-cmd -s register /vmfs/volumes/datastore/vm-new/vm-new.vmx

Thursday, February 14, 2008

The ultimate plugin to VC 2.5 – SVmotion

Filed under: ESX Migrate/Upgrade,ESXi,Tools,Virtual Center,vSphere (ESX) — A. Mikkelsen @ 13:47 pm

The people over at Lostcrations have created the first known third party plugin to VC 2.5.

It enables you to SVmotion your VM’s VMDK’s between different storage locations

Take a look at it

Saturday, February 9, 2008

vRanger script

Filed under: Disaster Recovery,Scripting,Security,Virtual Center,vRanger,vSphere (ESX) — A. Mikkelsen @ 16:47 pm

At work we use vRanger to take DR snapshots of all our VM’s (more than 370).

We decided that we would only snapshot drive 0 and use a TSM client to backup tha data in each VM and that the snapshots were only to be taken outside working hours.
These choices gave us some problems when running vRanger because we couldn’t schedule the snapshots from vRanger.

The solution was to make our own script that would handle the logic and just use vRanger to do the actual snapshotting.
We created a VBS script to hold the logic.
Create a log file
Delete snapshots from the day before (do to lack of storage space on the server)
Call the .cmd file that holds the information on witch VM’s to snapshot (Based on weekday – one file for each day).
Start TSM (send the VM’s snapshots to tape)
Send a status mail

We then created 7 .cmd files (one for each weekday) in witch we add a line for each VM to snapshot that day.
(You have to use vRanger GUI to choose witch drives to snapshot – changed from 3.17 -> 3.20)

I know this solution isn’t very dynamic but i works.

I’m in the process of upgrading the script so that it dynamicly creates a list of witch VM’s to snapshot based on a custom field in VC.
Furthermore i also want to create a script to update the vRanger database with witch drives to snapshot based on a custom field in VC.

I will upload the updated script as soon as it is done.
You can download the current script here.

Monday, January 7, 2008

A easy way to document and import VC Roles and Permissions

Filed under: ESXi,Scripting,Virtual Center,vSphere (ESX) — A. Mikkelsen @ 9:03 am

René vd Linden  at www.renevdlinden.nl has released a excel sheet that can be used to document and update roles and permissions in VC.

It look very easy and straight forward.


A. Mikkelsen

Thursday, December 6, 2007

The power of VIPerlToolkit

Filed under: Scripting,Virtual Center — A. Mikkelsen @ 21:23 pm

Over the past 2 weeks i have been playing around with the VIperlToolkit and discovered hwo easy and powerfull it is. Some of the scripts i have created is avaiable for download in the Download section of this site.

I first came accross the VIPerlToolkit about 8 months ago when looking through www.run-virtual.com.
I got inspired by Richards script that created and updated custom fields in Virtual Center, and i decided to add some more information to my Virtual Center.

Below is a screenshot of my Virtual Center witch is running version 1.1 of vcinfo.pl

The script automatically updates the following information in Virtual Center:

  • All virtual networks attached
  • List if VM has snapshots
  • The path and name of the VMX file
  • The size of each attached VMDK file
  • The path and name of each VMDK file
  • The freespace in each VMDK file
    (Requires VMwareTools to be running)

To run the script you need to install ViPerlToolkit and Perl on your VirtualCenter server (Howto from www.run-virtual.com).
Or run tit in the VMware ViPerlToolkit Appliance (Download it from www.vmware.com).

This will not be my last script 😉

A. Mikkelsen

Monday, August 13, 2007

What features can we expect to see in the next release of ESX VI (3.1.0)

Filed under: ESX Migrate/Upgrade,Hardware,Tools,Virtual Center — A. Mikkelsen @ 10:23 am

The people at www.virtualization.info have put together a list of the new features in ESX 3.1.0.

The only thing now is when will it be released.

A. Mikkelsen

Thursday, June 21, 2007

Cool add-on to Virtual Center 2.x from Run-virtual.com

Filed under: Tools,Virtual Center — A. Mikkelsen @ 12:11 pm

Someone informed me on this very usefull add-on for Virtual Center 2.x.

VCplus           – http://www.run-virtual.com/?page_id=184

Haven’t tried it myself yet, but i will during next week.
I think that this add-on is a step in the right direction. Mayby VMware should implement this add-on in VC.

Nice job Richard …. Keep it up….

A. Mikkelsen

« Newer Posts

Powered by WordPress