VMware Cloud Community
robnauticus
Contributor
Contributor
Jump to solution

Problem with VM on ESXi6 - Tried to expand VMDK with snapshot

Hi folks,

Getting stuck on what I thought would be a simple task. I attempted to expand a volume on a store from 240GB to 350GB. I executed the command in ssh vmkfstools -X 350GB CAS-SQL-02-Vista-000001.vmdk. It seemed to work but the disk size did not change inside Vsphere. I started looking up issues and it was mentioned that doing this with snapshots is bad...

I then attempted to delete the single parent snapshot from the VM. However the disk then reverted to 40GB in size and cannot start due to "The capacity of the parent virtual disk and the capacity of the child disk are different.

Can I get a little guidance on how to correct this? It's kinda an emergency...

Thanks!

I started following this post but I'm not sure if it applies.

Getting error: The capacity of the parent virtual disk and the capacity of the child disk are differ...

CAS-SQL-02-Vista.vmdk

# Disk DescriptorFile

version=1

encoding="UTF-8"

CID=98d30ec0

parentCID=ffffffff

isNativeSnapshot="no"

createType="vmfs"

# Extent description

RW 734003200 VMFS "CAS-SQL-02-Vista-flat.vmdk"

# The Disk Data Base

#DDB

ddb.adapterType = "lsilogic"

ddb.geometry.cylinders = "45689"

ddb.geometry.heads = "255"

ddb.geometry.sectors = "63"

ddb.longContentID = "8405a2266d61df0a05d92e067de65ca3"

ddb.thinProvisioned = "0"

ddb.toolsVersion = "8394"

ddb.uuid = "60 00 C2 96 c0 9c 54 db-55 2f 6f eb 95 b3 74 95"

ddb.virtualHWVersion = "8"

CAS-SQL-02-Vista-000001.vmdk

# Disk DescriptorFile

version=1

encoding="UTF-8"

CID=f1bad950

parentCID=98d30ec0

isNativeSnapshot="no"

createType="vmfsSparse"

parentFileNameHint="CAS-SQL-02-Vista.vmdk"

# Extent description

RW 503316480 VMFSSPARSE "CAS-SQL-02-Vista-000001-delta.vmdk"

# The Disk Data Base

#DDB

ddb.longContentID = "e862763da1159027f70d9bedf1bad950"

ddb.toolsVersion = "10246"

drwxr-xr-x    1 root     root        2.3K Aug 16 21:02 .

drwxr-xr-t    1 root     root        1.5K Aug 16 19:37 ..

-rw-------    1 root     root       93.6G Aug 16 19:32 CAS-SQL-02-Vista-000001-delta.vmdk

-rw-------    1 root     root         363 Aug  2 17:53 CAS-SQL-02-Vista-000001.vmdk

-rw-------    1 root     root      350.0G Aug 16 20:00 CAS-SQL-02-Vista-flat.vmdk

-rw-------    1 root     root        8.5K Aug 16 19:32 CAS-SQL-02-Vista.nvram

-rw-------    1 root     root         531 Aug 16 20:30 CAS-SQL-02-Vista.vmdk

-rw-r--r--    1 root     root          77 Aug 16 20:59 CAS-SQL-02-Vista.vmsd

-rwxr-xr-x    1 root     root        3.0K Aug 16 20:59 CAS-SQL-02-Vista.vmx

-rw-r--r--    1 root     root        3.9K Nov  3  2017 CAS-SQL-02-Vista.vmxf

-rw-r--r--    1 root     root      391.0K Oct 18  2017 vmware-15.log

-rw-r--r--    1 root     root        1.9M Nov  6  2017 vmware-16.log

-rw-r--r--    1 root     root        2.3M Jun 15 12:43 vmware-17.log

-rw-r--r--    1 root     root      683.3K Jul  4 08:46 vmware-18.log

-rw-r--r--    1 root     root      315.3K Aug  1 15:09 vmware-19.log

-rw-r--r--    1 root     root      447.3K Aug 16 19:32 vmware-20.log

-rw-r--r--    1 root     root       55.8K Aug 16 21:02 vmware.log

Message was edited by: robnauticus Added second vmdk text

Message was edited by: robnauticus Added details of folder to see sizes. Removed image of folder

1 Solution

Accepted Solutions
a_p_
Leadership
Leadership
Jump to solution

Ok, then let's see whether we can workaround this issue.

As mentioned earlier, please ensure that you have a backup of the VM's files!!!

  1. extract the files/folders from attached archive
  2. unregister the VM from the vSphere Client (remove from inventory - DON'T delete from disk)
  3. upload the 4 "240GB" files to the VM's folder on the datastore
  4. register the VM (add VM to the inventory)
  5. create another snapshot
  6. check whether the VM powers on, contains current data, and works as expected
  7. shutdown the VM
  8. open the Snapshot Manager, and select "Delete All" snapshots (this may take a few minutes, due to the snapshot's size)
  9. unregister the VM from the vSphere Client (remove from inventory - DON'T delete from disk)
  10. upload the "350GB" file to the VM's folder on the datastore
  11. register the VM (add VM to the inventory)
  12. create a new snapshot

At this point you should be able to power on the VM, and increase the partition from within the guest OS.

If everything works as expected, don't forget to delete the VM's snapshot again.

André

View solution in original post

Reply
0 Kudos
12 Replies
continuum
Immortal
Immortal
Jump to solution

You will also need to make sure that the file CAS-SQL-02-Vista-000001.vmdk uses the same value for size in sectors - (thats the number following the RW)
Show us both vmdk-descriptorfiles ....


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

robnauticus
Contributor
Contributor
Jump to solution

I've updated the vmdk files to match the expected 350GB size descriptor.

In the folder browsing the datastore it looks like the base vmdk file is correctly at 350GB. See file list below.

I've went ahead and tried to boot the machine but the hard drive appears to be 175TB? Max size is 4.xx TB for store.

The hard drive is pointed to [Second Store 5TB] CAS-SQL-02-Vista/CAS-SQL-02-Vista-000001.vmdk

Both other vmdk files are pointed to the delta vmdk file that is 93GB. Is that correct?

The main vmdk file is pointed to the flat file.

-rw-------    1 root     root       93.6G Aug 16 19:32 CAS-SQL-02-Vista-000001-delta.vmdk

-rw-------    1 root     root         366 Aug 17 17:22 CAS-SQL-02-Vista-000001.vmdk

-rw-------    1 root     root      350.0G Aug 16 20:00 CAS-SQL-02-Vista-flat.vmdk

-rw-------    1 root     root        8.5K Aug 16 19:32 CAS-SQL-02-Vista.nvram

-rw-------    1 root     root         534 Aug 17 17:20 CAS-SQL-02-Vista.vmdk

-rw-r--r--    1 root     root          77 Aug 16 20:59 CAS-SQL-02-Vista.vmsd

-rwxr-xr-x    1 root     root        3.4K Aug 17 17:26 CAS-SQL-02-Vista.vmx

-rw-r--r--    1 root     root        3.9K Nov  3  2017 CAS-SQL-02-Vista.vmxf

Current VMDK files

CAS-SQL-02-Vista.vmdk

# Disk DescriptorFile

version=1

encoding="UTF-8"

CID=98d30ec0

parentCID=ffffffff

isNativeSnapshot="no"

createType="vmfs"

# Extent description

RW 375809638400 VMFS "CAS-SQL-02-Vista-flat.vmdk"

# The Disk Data Base

#DDB

ddb.adapterType = "lsilogic"

ddb.geometry.cylinders = "45689"

ddb.geometry.heads = "255"

ddb.geometry.sectors = "63"

ddb.longContentID = "8405a2266d61df0a05d92e067de65ca3"

ddb.thinProvisioned = "0"

ddb.toolsVersion = "8394"

ddb.uuid = "60 00 C2 96 c0 9c 54 db-55 2f 6f eb 95 b3 74 95"

ddb.virtualHWVersion = "8"

CAS-SQL-02-Vista-000001.vmdk

# Disk DescriptorFile

version=1

encoding="UTF-8"

CID=f1bad950

parentCID=98d30ec0

isNativeSnapshot="no"

createType="vmfsSparse"

parentFileNameHint="CAS-SQL-02-Vista.vmdk"

# Extent description

RW 375809638400 VMFSSPARSE "CAS-SQL-02-Vista-000001-delta.vmdk"

# The Disk Data Base

#DDB

ddb.longContentID = "e862763da1159027f70d9bedf1bad950"

ddb.toolsVersion = "10246"

Reply
0 Kudos
robnauticus
Contributor
Contributor
Jump to solution

Attached is the complete folder / directory for the VM.

I skipped the actual data vmdk files which I'll list below with their sizes.

-rw-------    1 root     root       93.6G Aug 16 19:32 CAS-SQL-02-Vista-000001-delta.vmdk

-rw-------    1 root     root      350.0G Aug 16 20:00 CAS-SQL-02-Vista-flat.vmdk

Thanks!

Reply
0 Kudos
robnauticus
Contributor
Contributor
Jump to solution

Update:

I set the second vmdk file (CAS-SQL-02-Vista-000001.vmdk) to the actual size of the delta file (CAS-SQL-02-Vista-000001-delta.vmdk) as it stands.

I then re-added this file as a existing VHD on the machine.

In settings when I re-added the drive the size appeared correct (350GB) but once it saved it reverted back to the 175TB which is obviously wrong.

I now get the error on power on:

Failed to power on virtual machine CAS-SQL-02-Vista. The file specified is not a virtual disk 

Other Info:

[root@CASSELLESX-01:/vmfs/volumes/551efb4a-013401c2-43af-d4ae5266c08e/CAS-SQL-02-Vista] vmkfstools -x check CAS-SQL-02-Vista.vmdk

DiskLib_Check() failed for source disk 'CAS-SQL-02-Vista.vmdk': The destination file system does not support large files (12).

[root@CASSELLESX-01:/vmfs/volumes/551efb4a-013401c2-43af-d4ae5266c08e/CAS-SQL-02-Vista] vmkfstools -x check CAS-SQL-02-Vista-000001.vmdk

Disk is error free

pastedImage_1.png

Reply
0 Kudos
a_p_
Leadership
Leadership
Jump to solution

I started looking up issues and it was mentioned that doing this with snapshots is bad...

I fully agree, it's really not a good idea 😉

Anyway, there might be an option to resolve/workaround this. However, prior to providing you with temporary files, and steps, I'd like to ask you some questions to fully understand the current situation.

1.) You mentioned that you resized the snapshot using:

vmkfstools -X 350GB CAS-SQL-02-Vista-000001.vmdk

Please don't mind me, but I think that you rather resized the base virtual disk. Trying to resize a snapshot isn't possible, and will result in the following error message:

Failed to extend disk : The called function cannot be performed on partial chains. Open the parent virtual disk (5).

2.) The configuration (.vmx) file points to:

ide0:1.fileName = "CAS-SQL-02-Vista.vmdk"

Did you try to power on the VM from the base disk? This is also not a good idea, because it will most likely result in more, or less data corruption, if we can manage to resolve the snapshot issue.

The virtual disk is connected to an IDE controller "ide0:1", but the virtual disk files are configured as scsi devices "lsilogic". Did you change the VM's configuration, or can you explain the reason for this?

André

PS: Unless already done, backup all the VM's files (especially the flat.vmdk, and delta.vmdk files) now!!!

Reply
0 Kudos
admin
Immortal
Immortal
Jump to solution

there might be an option to resolve/workaround this. However, prior to providing you with temporary files, and steps, I'd like to ask you some questions to fully understand the current situation.

Reply
0 Kudos
a_p_
Leadership
Leadership
Jump to solution

neyla12

You are welcome to participate in the discussion, but it relally doesn't make much sense to simply copy&paste parts of other user's replies.

André

robnauticus
Contributor
Contributor
Jump to solution

Hi Andre,

I think you are correct about which actual vmdk I expanded. I think I tried the -00001 file after

I did try and power up the machine from the base disk however it failed immediately every time.

I didn't change from scsi to IDE in the config file... Not sure how that got changed. It was LSI prior similar to my other VMs.

Reply
0 Kudos
a_p_
Leadership
Leadership
Jump to solution

Ok, then let's see whether we can workaround this issue.

As mentioned earlier, please ensure that you have a backup of the VM's files!!!

  1. extract the files/folders from attached archive
  2. unregister the VM from the vSphere Client (remove from inventory - DON'T delete from disk)
  3. upload the 4 "240GB" files to the VM's folder on the datastore
  4. register the VM (add VM to the inventory)
  5. create another snapshot
  6. check whether the VM powers on, contains current data, and works as expected
  7. shutdown the VM
  8. open the Snapshot Manager, and select "Delete All" snapshots (this may take a few minutes, due to the snapshot's size)
  9. unregister the VM from the vSphere Client (remove from inventory - DON'T delete from disk)
  10. upload the "350GB" file to the VM's folder on the datastore
  11. register the VM (add VM to the inventory)
  12. create a new snapshot

At this point you should be able to power on the VM, and increase the partition from within the guest OS.

If everything works as expected, don't forget to delete the VM's snapshot again.

André

Reply
0 Kudos
robnauticus
Contributor
Contributor
Jump to solution

Hi Andre,

Thanks for your help!

I've gotten to step 5 (taking a snapshot w/240 GB fix applied) but I'm getting the error:

Create Snapshot

Key

haTask-34-vim.VirtualMachine.createSnapshot-11579

Description

Create a new snapshot of this virtual machine

Virtual machine:

CAS-SQL-02-Vista

State

Failed - Invalid virtual machine configuration.

Errors

  • 0">
  • An error occurred while taking a snapshot: Configuration file problem.

Reply
0 Kudos
a_p_
Leadership
Leadership
Jump to solution

Sorry about this, it looks like the system doesn't like the modified snapshot's descriptor (.vmsd) file.

Since we are going to delete all the snapshots anyway, this file can be safely deleted.

  1. unregister the VM from the vSphere Client (remove from inventory - DON'T delete from disk)
  2. delete the "CAS-SQL-02-Vista.vmsd" file from the datastore
  3. register the VM (add VM to the inventory)
  4. proceed with step 5 from the previous post.

André

Reply
0 Kudos
robnauticus
Contributor
Contributor
Jump to solution

André,

After following your last post I was able to get the machine to power on with the new size included!

Thanks so much for all the effort!

Rob

Reply
0 Kudos