Friday, July 10, 2009

Recreating a missing VMDK descriptor file

Recreating a missing VMDK descripter file
Posted on October 2nd, 2008 A. Mikkelsen 4 comments

A few weeks ago we were conducting a vRanger DR test of a VM (new host and new LUN).

The VM was restored succesfull, but when we powered it on we discovered that it for some unexplaned reason had lost the SCSI0:1 (100GB) and SCSI0:2(300GB) VMDK’s.
It had created two new 20GB VMDK’s instead.
We searched the LUN and found the two orginal *-flatvmdk files but not the descripter files.

Use Putty to identify the size of the *-flatvmdk file. ex. 100GB

ls -lah

From a VM (not running) create a new disk with the same size as the one you are missing. The name is not important.

Locate the newly created *.vmdk and *-flat.vmdk file. Copy the new *.vmdk file to the folder that contains the orginal *-flat.vmdk file.

cp rescue_me.vmdk /vmfs/volumes/mysan/rescued/rescued.vmdk

Use VI or NANO to change the following line as below from:
RW 419426200 VMFS “rescue_me-flat.vmdk”
To:
RW 419430500 VMFS “rescued-flat.vmdk”

Make sure that the name of the .vmdk file correspond to the SCSI*:*.fileName in the vmx file.
Now just power on the VM and the orginal disks are intac.

UPDATE
Today I found out that esXpress has created a website that can create a VMDK descriptor file.
http://www.esxpress.com/tools/wrapgen.php


http://www.amikkelsen.com/?p=93

Monday, March 23, 2009

Using 64 bit Virtual Machines with ESX 3.5

in order to set up and install 64 bit Windows servers as virtual machines in ESX 3.5, a bios setting change has to be made.

1. enable VT
a. in bios, select Advanced Options -> Processor Options -> Intel VT
b. change from "Disabled" to "Enabled"
2. if that doesn't work, try
a. Advanced Options -> Processor Options -> No-Execute Page-Protection
b. change from "Disabled" to "Enabled"

Wednesday, November 5, 2008

Election

Wow - what a night...

First let me say that i'm a republican from way back, but i've never been a goose-stepping moron who votes the party regardless of its direction. i believe in the fundamental ability of individuals to change themselves and, in so doing, change the world.

however, i have never been comfortable with the marriage of the "old" republican party with the ideals of the social conservative movement. i am a fiscal conservative and a social liberal - end of story. as a result, over the past two and a half decades i have been increasingly at odds with my own party. Never more so than with "W". I think that on a personal level, if i ever had the chance to get to know him, i would like the guy. but i abhor his management style, his outlook and his policies. i think they represent the worst of America.

When the election cycle started, i'd never heard of Barack Obama. I knew that Hillary Clinton was an intelligent, driven person with a tremendous potential - but i also knew that she was a polarizing figure - and that was the last thing i felt the country needed. Thanks to "W", the country was at odds with itself enough as it was. So, in the primary i voted for Edwards - for any number of reasons which i wont detail here.

My oldest son, at 20, saw things much differently. He read everything he could on the candidates, with all the enthusiasm of youth and their first chance to exercise their civic duty at the voting booth. And for months he's been telling me - Obama's the guy.

Like so many other Americans, i watched the debates and when i did, i saw what my son saw - an intelligent, thoughtful man with the enthusiasm and determination of youth and the wisdom of experience, with a dash of "calm, cool and collected" thrown in for good measure. Oh, yeah, and who happened to be african american...

As the days led up to the election, i became increasingly involved, actually donating money to a candidate for the first time in my life - following my oldest son's example. As we sat around the dinner table Monday night, i was was talking to my wife, and my three boys and i looked at my oldest son and said "your generation will decide this election"

they did.

they and millions of others, who were tired of fear, tired of division, tired of discord. and as i watched the election results along with my family, we knew that history was being written before our eyes. we talked about how that two generations ago, an african american man in Virginia couldnt drink out of the water fountain as a white american and that today Virginia elected an african american man president.

i'm old and with age comes a certain amount of cyncism. but last night, as i listened to the words of our president elect, i was filled with hope for our nation and our world. for the first time in a long while, i was proud to be an american. This morning, as i watched Squawk Box on CNBC, i heard Jack Welch, the former CEO of GE, talk of being proud to be an american.

today and in the days ahead, i think we can all be proud that we are americans. not because we're somehow better than everyone else, not because we have the biggest military, not because we're the wealthiest country on earth, but because we once again proved that "government of the people, by the people, for the people, shall not perish from the earth..."

Setting a Virtual Machine's MAC Address

If you ever have the need to manually set the MAC address for a virtual machine, be aware that there is a limitation. There are two pools of potential MAC addresses - one for automatic assignment and one for manual assignment.

we had a situation where - because we were using software that generated its key based on MAC address - we wanted to migrate to from a physical machine that had died to a vm and the software was so old that the company was no longer in business. the rub was that the licensing was based on MAC address.

our initial thought was to re-assign the existing MAC address as we were never going to use the old server as it was being trashed. however, when i built the new vm i and then tried to assign the MAC address (Virtual Center --> Edit Settings --> Network Adapter 1), i received the following warning:

The MAC Address entered is not in the valid range. Valid values are between XX:XX:XX:XX:XX:XX and XX:XX:XX:XX:XX:XX


this appears to be due to the fact that different ranges of MAC addresses are used depending on whether the address was generated with the vm or manually assigned.

So how to address - no pun intended?

well, i chose to edit the vm's vmx file directly. in the file there is a reference to the MAC address for the virtual NIC. Simply edit this value - with all the obvious warnings taken to heart about duplicate values - and restart the vm:

ethernet0.generatedAddress = "XX:XX:XX:XX:XX:XX"

You should be good to go from there...

Wednesday, October 29, 2008

Creating a User Defined Service on Windows 2000/2003

1. Login to the target server

2. Install the appropriate resource kit (WIN2K, WIN2K3, etc.)

3. Navigate to the installation directory

a. Default is C:\Program Files\Windows Resource Kits\Tools

4. Run the following command

a. >instsrv.exe "C:\Program Files\Windows Resource Kits\Tools\srvany.exe"

b. Where

i. Instsrv is the resource kit tool to setup the service

ii. is the name that will appear in Services

iii. "C:\Program Files\Windows Resource Kits\Tools\srvany.exe" is the complete path to the SRVANY.EXE resource kit tool

5. Once the command has been issued, a successful installation will receive the following result:

a. The service was successfuly added!

6. Next, open REGEDIT and navigate to the following location:

a. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\

7. From the Edit menu, click Add Key and name it Parameters

8. Next from the Edit menu, click Add Value and type this information.

a. Value Name: Application

b. Data Type : REG_SZ

c. String : \

9. Now, in the Services Applet

a. Optional - modify the login information for the service

b. Optional - change the startup type

c. Start the service


vmware-cmd fails

i moved a virtual machine from one host to another today and since it resided on local storage, i used our trusty vRanger to back it up to the new machine and then restore it. Once there, all i should have had to do was run the following command:

vmware-cmd -s register vmfs/volume///.vmx

however, when i did this, the command failed complaining about Perl

i then tried to run the configuration for perl using the following command

vmware-config.pl

but this errored out as well. found that there are issues with the vmware-config.pl command when the ESX server's time is considerably at odds with the actual time. This was the case for me as i had just installed this host.

1. i reset the time to the current value
2. re-ran vmware-config.pl (success this time)
3. re-ran vmware-cmd -s register vmfs/volume///.vmx (success)

Moral of the story - if you get strange errors with perl, make sure your host time is correct...

Tuesday, October 14, 2008

SQL Server 2005 Installation Issues

I've installed SQL Server 2000 at least 200 times in my career and its seldom ever given me any heartburn. Then along comes SQL Server 2005 and its installation is the biggest consistent pain in the neck i've ever worked with. Why exactly did they have to rework something that was already working?

Today I had to install 2005 for another component installation and after at least an hour it finally reached the point where it was installing the workstation components...and it sat there...and sat there...and sat there - for at least an hour. I didnt want to kill the installation, because i've done that before and that caused 2-3 days of hacking and cleanup.

So, i started searching and eventually ran across something i had forgotten - that if the 2005 installation hangs, try disconnecting the network cable - which, after another 20 minutes, caused the install to pick up and finally finish.

What kind of ridiculous solution is that for a something that's supposed to be enterprise-class software?

good grief