Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 0. attach HDD to linux machine, and mount VMFS
- - vmfs-fuse
- - vmfs-tools
- 1. recover VM system files:
- - Host-000001-delta.vmdk /1st snapshot file/
- - Host-000004-delta.vmdk /2nd snapshot file/
- - Host-flat.vmdk /VM's filesystem file/
- 2. generate descriptor file for Host-flat.vmdk:
- # cd /vmfs/volumes/4b60b1fa-810d9754-167f-78e7d1f52133/Host /where my VM was stored/
- # ls -la
- -rw-r--r-- 1 root root 4865806336 Oct 12 21:17 Host-000001-delta.vmdk
- -rw-r--r-- 1 root root 19445207040 Oct 12 21:51 Host-000004-delta.vmdk
- -rw-r--r-- 1 root root 214748364800 Oct 12 21:00 Host-flat.vmdk
- # vmkfstools -c 214748364800 -a lsisata -d thin Host-tmp.vmdk
- ## where -c = 214748364800 size of Host-flat.vmdk in bits
- ## -a = type of VM's disk
- ## Host-tmp.vmdk - name of new vmdk file
- # cp Host-tmp.vmdk Host.vmdk
- # vi Host.vmdk
- ------------# Disk DescriptorFile--------------------
- version=1
- encoding="UTF-8"
- CID=e4037185 <----------remember HOST.CID
- parentCID=ffffffff
- isNativeSnapshot="no"
- createType="vmfs"
- # Extent description
- RW 419430400 VMFS "Host-tmp-flat.vmdk" <----------REMOVE
- RW 419430400 VMFS "Host-flat.vmdk" <----------ADD
- # The Disk Data Base
- #DDB
- ddb.adapterType = "lsilogic"
- ddb.thinProvisioned = "1"
- ddb.geometry.sectors = "63"
- ddb.geometry.heads = "255"
- ddb.geometry.cylinders = "26108"
- ddb.uuid = "60 00 C2 95 ee da b9 c4-36 67 dd 85 15 bb c6 0f"
- ddb.longContentID = "498a171b9bf5aab9d46bbe99e4037185"
- ddb.virtualHWVersion = "8"
- ---------------------EOF----------------------------------
- # rm -r Host-tmp* / remove temp files /
- 3. create NEW VM {named: WWW} ...... add disk -> path to datastore_old/Host -> Host.vmdk
- 4. Power_on WWW, boot, make snapshot, shutdown
- 5. Edit new VM Snapshot's descriptor file - Host-000002.vmdk in cur dir:
- # ls -la
- Host-000001-delta.vmdk
- Host-000002-delta.vmdk
- Host-000002.vmdk
- Host-000004-delta.vmdk
- Host-flat.vmdk
- Host.vmdk
- # cp Host-000002.vmdk Host-000001.vmdk
- # vi Host-000001.vmdk
- --------------------# Disk DescriptorFile---------------------------
- version=1
- encoding="UTF-8"
- CID=9746bb38 <-------- remember HOST-000001.CID
- parentCID=e4037185 <------- HOST.CID
- isNativeSnapshot="no"
- createType="vmfsSparse"
- parentFileNameHint="Host.vmdk"
- # Extent description
- RW 419430400 VMFSSPARSE "Host-000002-delta.vmdk" <----------REMOVE
- RW 419430400 VMFSSPARSE "Host-000001-delta.vmdk" <----------ADD
- # The Disk Data Base
- #DDB
- ddb.longContentID = "b8f451b3b0c94e8c4848eeef9746bb38"
- --------------------------EOF-----------------------------------------
- 6. Edit VM's conf files {WWW.vmx}:
- # cd /vmfs/volumes/4b60b1fa-810d9754-167f-78e7d1f52133/WWW
- # vi WWW.vmx
- .encoding = "UTF-8"
- config.version = "8"
- virtualHW.version = "7"
- pciBridge0.present = "TRUE"
- pciBridge4.present = "TRUE"
- pciBridge4.virtualDev = "pcieRootPort"
- pciBridge4.functions = "8"
- pciBridge5.present = "TRUE"
- pciBridge5.virtualDev = "pcieRootPort"
- pciBridge5.functions = "8"
- pciBridge6.present = "TRUE"
- pciBridge6.virtualDev = "pcieRootPort"
- pciBridge6.functions = "8"
- pciBridge7.present = "TRUE"
- pciBridge7.virtualDev = "pcieRootPort"
- pciBridge7.functions = "8"
- vmci0.present = "TRUE"
- nvram = "WWW.nvram"
- virtualHW.productCompatibility = "hosted"
- powerType.powerOff = "soft"
- powerType.powerOn = "hard"
- powerType.suspend = "hard"
- powerType.reset = "soft"
- displayName = "WWW"
- extendedConfigFile = "WWW.vmxf"
- floppy0.present = "TRUE"
- scsi0.present = "TRUE"
- scsi0.sharedBus = "none"
- scsi0.virtualDev = "lsilogic"
- memsize = "1024"
- scsi0:0.present = "TRUE"
- scsi0:0.fileName = "/vmfs/volumes/4b60b1fa-810d9754-167f-78e7d1f52133/Host/Host-000002.vmdk" <--------REMOVE
- scsi0:0.fileName = "/vmfs/volumes/4b60b1fa-810d9754-167f-78e7d1f52133/Host/Host-000001.vmdk" <---------ADD
- scsi0:0.deviceType = "scsi-hardDisk"
- ide1:0.present = "TRUE"
- ide1:0.clientDevice = "TRUE"
- ide1:0.deviceType = "cdrom-raw"
- ide1:0.startConnected = "FALSE"
- floppy0.startConnected = "FALSE"
- floppy0.fileName = ""
- floppy0.clientDevice = "TRUE"
- ethernet0.present = "TRUE"
- ethernet0.virtualDev = "e1000"
- ethernet0.networkName = "VM Network"
- ethernet0.addressType = "generated"
- guestOS = "debian5-64"
- uuid.location = "56 4d c2 28 8d cf d4 06-0b c5 28 82 f7 80 61 b8"
- uuid.bios = "56 4d c2 28 8d cf d4 06-0b c5 28 82 f7 80 61 b8"
- vc.uuid = "52 e5 e7 cc c7 f9 6a d7-ef 2d 69 fb 87 a0 db 99"
- ethernet0.generatedAddress = "00:0c:29:80:61:b8"
- vmci0.id = "-142581320"
- cleanShutdown = "FALSE"
- replay.supported = "FALSE"
- sched.swap.derivedName = "/vmfs/volumes/4b60b1fa-810d9754-167f-78e7d1f52133/WWW/WWW-cfeb4548.vswp"
- replay.filename = ""
- scsi0:0.redo = ""
- pciBridge0.pciSlotNumber = "17"
- pciBridge4.pciSlotNumber = "21"
- pciBridge5.pciSlotNumber = "22"
- pciBridge6.pciSlotNumber = "23"
- pciBridge7.pciSlotNumber = "24"
- scsi0.pciSlotNumber = "16"
- ethernet0.pciSlotNumber = "32"
- vmci0.pciSlotNumber = "33"
- ethernet0.generatedAddressOffset = "0"
- hostCPUID.0 = "0000000b756e65476c65746e49656e69"
- hostCPUID.1 = "000106e5001008000098e3fdbfebfbff"
- hostCPUID.80000001 = "00000000000000000000000128100800"
- guestCPUID.0 = "0000000b756e65476c65746e49656e69"
- guestCPUID.1 = "000106e500010800809822010febfbff"
- guestCPUID.80000001 = "00000000000000000000000128100800"
- userCPUID.0 = "0000000b756e65476c65746e49656e69"
- userCPUID.1 = "000106e500100800009822010febfbff"
- userCPUID.80000001 = "00000000000000000000000128100800"
- evcCompatibilityMode = "FALSE"
- vmotion.checkpointFBSize = "4194304"
- tools.remindInstall = "TRUE"
- -----------------------EOF--------------------------
- 7. Run VM, it's seems to boot first snapshot file old VM {Host}, make second snapshot, shutdown
- 8. like p.5. Edit new VM Snapshot's descriptor file - Host-000003.vmdk in cur dir:
- # ls -la
- Host-000001-delta.vmdk
- Host-000001.vmdk
- Host-000002-delta.vmdk
- Host-000002.vmdk
- Host-000003-delta.vmdk
- Host-000003.vmdk
- Host-000004-delta.vmdk
- Host-flat.vmdk
- Host.vmdk
- # cp Host-000003.vmdk Host-000004.vmdk
- # vi Host-000004.vmdk
- --------------------# Disk DescriptorFile---------------------------
- version=1
- encoding="UTF-8"
- CID=b722bb23 <--------HOST-000004.CID
- parentCID=9746bb38 <------- HOST-000001.CID
- isNativeSnapshot="no"
- createType="vmfsSparse"
- parentFileNameHint="Host.vmdk"
- # Extent description
- RW 419430400 VMFSSPARSE "Host-000003-delta.vmdk" <----------REMOVE
- RW 419430400 VMFSSPARSE "Host-000004-delta.vmdk" <----------ADD
- # The Disk Data Base
- #DDB
- ddb.longContentID = "b8f451b3b0c94e8c4848eeef9746bb38"
- --------------------------EOF-----------------------------------------
- 9. Edit VM's conf files {WWW.vmx}:
- # cd /vmfs/volumes/4b60b1fa-810d9754-167f-78e7d1f52133/WWW
- # vi WWW.vmx
- ------------WWW.vmx--------------------------------
- .encoding = "UTF-8"
- config.version = "8"
- virtualHW.version = "7"
- pciBridge0.present = "TRUE"
- pciBridge4.present = "TRUE"
- pciBridge4.virtualDev = "pcieRootPort"
- pciBridge4.functions = "8"
- pciBridge5.present = "TRUE"
- pciBridge5.virtualDev = "pcieRootPort"
- pciBridge5.functions = "8"
- pciBridge6.present = "TRUE"
- pciBridge6.virtualDev = "pcieRootPort"
- pciBridge6.functions = "8"
- pciBridge7.present = "TRUE"
- pciBridge7.virtualDev = "pcieRootPort"
- pciBridge7.functions = "8"
- vmci0.present = "TRUE"
- nvram = "WWW.nvram"
- virtualHW.productCompatibility = "hosted"
- powerType.powerOff = "soft"
- powerType.powerOn = "hard"
- powerType.suspend = "hard"
- powerType.reset = "soft"
- displayName = "WWW"
- extendedConfigFile = "WWW.vmxf"
- floppy0.present = "TRUE"
- scsi0.present = "TRUE"
- scsi0.sharedBus = "none"
- scsi0.virtualDev = "lsilogic"
- memsize = "1024"
- scsi0:0.present = "TRUE"
- scsi0:0.fileName = "/vmfs/volumes/4b60b1fa-810d9754-167f-78e7d1f52133/Host/Host-000003.vmdk" <--------REMOVE
- scsi0:0.fileName = "/vmfs/volumes/4b60b1fa-810d9754-167f-78e7d1f52133/Host/Host-000004.vmdk" <---------ADD
- scsi0:0.deviceType = "scsi-hardDisk"
- ide1:0.present = "TRUE"
- ide1:0.clientDevice = "TRUE"
- ide1:0.deviceType = "cdrom-raw"
- ide1:0.startConnected = "FALSE"
- floppy0.startConnected = "FALSE"
- floppy0.fileName = ""
- floppy0.clientDevice = "TRUE"
- ethernet0.present = "TRUE"
- ethernet0.virtualDev = "e1000"
- ethernet0.networkName = "VM Network"
- ethernet0.addressType = "generated"
- guestOS = "debian5-64"
- uuid.location = "56 4d c2 28 8d cf d4 06-0b c5 28 82 f7 80 61 b8"
- uuid.bios = "56 4d c2 28 8d cf d4 06-0b c5 28 82 f7 80 61 b8"
- vc.uuid = "52 e5 e7 cc c7 f9 6a d7-ef 2d 69 fb 87 a0 db 99"
- ethernet0.generatedAddress = "00:0c:29:80:61:b8"
- vmci0.id = "-142581320"
- cleanShutdown = "FALSE"
- replay.supported = "FALSE"
- sched.swap.derivedName = "/vmfs/volumes/4b60b1fa-810d9754-167f-78e7d1f52133/WWW/WWW-cfeb4548.vswp"
- replay.filename = ""
- scsi0:0.redo = ""
- pciBridge0.pciSlotNumber = "17"
- pciBridge4.pciSlotNumber = "21"
- pciBridge5.pciSlotNumber = "22"
- pciBridge6.pciSlotNumber = "23"
- pciBridge7.pciSlotNumber = "24"
- scsi0.pciSlotNumber = "16"
- ethernet0.pciSlotNumber = "32"
- vmci0.pciSlotNumber = "33"
- ethernet0.generatedAddressOffset = "0"
- hostCPUID.0 = "0000000b756e65476c65746e49656e69"
- hostCPUID.1 = "000106e5001008000098e3fdbfebfbff"
- hostCPUID.80000001 = "00000000000000000000000128100800"
- guestCPUID.0 = "0000000b756e65476c65746e49656e69"
- guestCPUID.1 = "000106e500010800809822010febfbff"
- guestCPUID.80000001 = "00000000000000000000000128100800"
- userCPUID.0 = "0000000b756e65476c65746e49656e69"
- userCPUID.1 = "000106e500100800009822010febfbff"
- userCPUID.80000001 = "00000000000000000000000128100800"
- evcCompatibilityMode = "FALSE"
- vmotion.checkpointFBSize = "4194304"
- tools.remindInstall = "TRUE"
- -----------------------EOF--------------------------
- #vi WWW.vmsd
- --------------WWW.vmsd---------------------------------
- .encoding = "UTF-8"
- snapshot.lastUID = "15"
- snapshot.current = "15"
- snapshot0.uid = "1"
- snapshot0.filename = "WWW-Snapshot1.vmsn"
- snapshot0.displayName = "1"
- snapshot0.description = "1"
- snapshot0.createTimeHigh = "306976"
- snapshot0.createTimeLow = "1352099533"
- snapshot0.numDisks = "1"
- snapshot0.disk0.fileName = "/vmfs/volumes/4b60b1fa-810d9754-167f-78e7d1f52133/Host/Host.vmdk" <---- CHECK PATH
- snapshot0.disk0.node = "scsi0:0"
- snapshot1.uid = "15"
- snapshot1.filename = "WWW-Snapshot2.vmsn"
- snapshot1.parent = "1"
- snapshot1.displayName = "2nd"
- snapshot1.description = "2nd"
- snapshot1.createTimeHigh = "306976"
- snapshot1.createTimeLow = "-1954189279"
- snapshot1.numDisks = "1"
- snapshot1.disk0.fileName = "/vmfs/volumes/4b60b1fa-810d9754-167f-78e7d1f52133/Host/Host-000001.vmdk" <---- CHECK PATH to first snapshot file
- snapshot1.disk0.node = "scsi0:0"
- snapshot.numSnapshots = "2"
- ---------------------_EOF--------------------------------
- 10. Run VM.
- It all ok, delete temp files: Host-000002* , Host-000003*
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement