Hi All
Had an interesting problem that I thought I would share. A customer today had deleted all the files associated with their VM except the flat-vmdk file. The resulted in the machine still running but was not being able to power the machine down or edit it in anyway.
They powered down the VM and attempted to recreate the VM and attach the flat=vmdk as a disk, but this is not possible. The flat-vmdk file contains the RAW data of the vmdk and is often not seen when using the datastore browser. What is used to connect disks is a vmdk file that is a metadata file and contains information mapping to the flat-vmdk. So without this you cannot connect any disks.
I have done a few of these on VI3 but this was my first vSphere and I wanted to check that nothing had changed in VM Hardware 7. So I found this article from VMware.
Gave it a quick going over and it all looks the same.
So I created a new VM with exactly the same disk layout, same size disks and everything. I created in on the same datastore as the original VM was located.
After this I powered on the VM, this is just to create the flat-vmdk file for the VM.
I then powered down the VM
logged onto the command line of the ESX sever and typed the following command to take me to
the VMFS locatation. cd/vmfs/volumes/datastorename/new_vm
From here I could remove the new VMs Flat-vmdk type ls to make sure you can see the file and then type rm new_vm-flat.vmdk You will be prompted to confirm
Once this has been removed you can then move the original flat-vmdk from the broken VM type cd ..
cd old_vm
You can then type the following to move the file. mv old_vm-flat.vmdk /vmfs/volumes/datastorename/new_vm
This will then move the flat-vmdk to the new VM working directory. You now need to browse to the new directory cd .. and then cd new_vm type ls to make sure the file is located in the directory.
now we need to change the name of the flat-vmdk to match the file in the vmdk header. we need to do a cat on the file to show us what it is looking for. type cat new_vm.vmdk you will see something like this.
-------------------------------------
# Disk DescriptorFile
version=1
CID=fb183c20
parentCID=ffffffff
createType="vmfs"
# Extent description
RW 8388608 VMFS "vmdisk0-flat.vmdk"
# The Disk Data Base
#DDB
ddb.virtualHWVersion = "4"
ddb.geometry.cylinders = "522"
ddb.geometry.heads = "255"
ddb.geometry.sectors = "63"
ddb.adapterType = "lsilogic"
ddb.thinProvisioned = "1"
-------------------------------------
We need to make a note of the line RW because we are going to change the name of our flat-vmdk to match this.
Once this has been noted type the following to change the name of the old flat-vmdk. mv old_vm-flat.vmdk new_vm-flat.vmdk This will then rename the file to that of the flat-vmdk listed in the file we ran cat against. you can check this by typing ls.
If there the same the VM will power on.
The customer I completed this for was very happy is going to delete file more carefully in future.
Thursday, 3 June 2010
Wednesday, 26 May 2010
Welcome - About me
Hi Everyone
Well this is my first blog, I thought I would start by saying "Hi" and telling you all a little about myself.
I am 23 and work as a Virtualization consultant. I work for a large Cloud based virtualization company. We specialize in many things as well as cloud computing. We have a Professional Services and a Managed Services team and I am the main managed services consultant, taking the lead on all services provided.
I have 4 years experiance in Virtualization and focus mainly on server Virtualization using VMware. I am a VCP 3 and VCP 4 as well as Microsoft 2003 MCSA security and one exam away from my MCTIP Enterprise administrator for 2K8 Server. I worked mainly in finance and telecommunications company's providing 3rd line support prior to vendor escalation. My consultancy role takes me all over the UK and I carry out all levels or work from installing a full vSphere or Hyper-V system from scratch to performing health checks of installations on VMware and other virtualization technology's.
I have decided to start a blog for the reason that most technical people do. I find keeping track of everything I learn difficult and often when people ask me questions I am too busy or have to dig out notes. Doing things this way I can share all my info and just refer people to my blog.
Well I have loads to share and will post everything up as soon as I can.
Thanks all
Well this is my first blog, I thought I would start by saying "Hi" and telling you all a little about myself.
I am 23 and work as a Virtualization consultant. I work for a large Cloud based virtualization company. We specialize in many things as well as cloud computing. We have a Professional Services and a Managed Services team and I am the main managed services consultant, taking the lead on all services provided.
I have 4 years experiance in Virtualization and focus mainly on server Virtualization using VMware. I am a VCP 3 and VCP 4 as well as Microsoft 2003 MCSA security and one exam away from my MCTIP Enterprise administrator for 2K8 Server. I worked mainly in finance and telecommunications company's providing 3rd line support prior to vendor escalation. My consultancy role takes me all over the UK and I carry out all levels or work from installing a full vSphere or Hyper-V system from scratch to performing health checks of installations on VMware and other virtualization technology's.
I have decided to start a blog for the reason that most technical people do. I find keeping track of everything I learn difficult and often when people ask me questions I am too busy or have to dig out notes. Doing things this way I can share all my info and just refer people to my blog.
Well I have loads to share and will post everything up as soon as I can.
Thanks all
Subscribe to:
Posts (Atom)