VMware Cloud Community
TurboBG
Contributor
Contributor
Jump to solution

Unable to change working directory

I'm attempting to change the working directory of a VM so that snapshots are stored on a different Datastore.

I used the following two articles for instruction:

"Creating snapshots in a different location than default virtual machine directory"

http://kb.vmware.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&docTypeID=DT_KB_1_1&e...

"Registering or adding a virtual machine to the inventory"

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=100616...

I unregistered my VM.  I added the following line to my .vmx:

workingDir = "/vmfs/volumes/4cb6d8b0-45f1b122-3a3a-d48564535eca/vm-snapshots"

This was copied straight from the directions.  The only thing I changed was the part of the path that identifies my datastore.

Note: I also tried using "vmsnapshots" to make sure the hyphen wasn't my problem, but I received the same error message.

I reregistered my VM.  I didn't have any problems adding the .vmx to the inventory.  When I right click on my VM and goto Edit Settings > Options, the Virtual Machine Working Location appears to be correct.  The 4cb6d8b0-45f1b122-3a3a-d48564535eca correctly translated to the identifier for the datastore (it looked like this: [DL360G7DS1] vm-snapshots/).  I powered on my VM.  I receive the following error message:

"This virtual machine cannot be powered on because its working directory is not valid. Please use the configuration editor to set a valid working directory, and then try again."

I wasn't sure if the "vm-snapshots" directory would be created automatically or if I should create it, so I tried both ways.  There are no spaces in my path or folder name.  I didn't change anything else in my .vmx, and when I remove the workingDir line, the VM powers on without issue.

There is a strong chance I am missing something very simple here.  The path appears to be accepted and pointing in the right direction.  I don't know what I need to do to "vm-snapshots" to make it valid.  The instructions didn't mention anything about the requirements for this directory.

Any advice would be greatly appreciated.  Please let me know if I didn't supply enough information or if the rest of my .vmx file needs to be posted.

0 Kudos
1 Solution

Accepted Solutions
a_p_
Leadership
Leadership
Jump to solution

Would I just place the .vmdk in the base folder of the new VM after I create it?

From what I understood so far, there's not enough free disk space on the "2MB" datastore to host the VM!? If there is enough free disk space then you can just migrate the VM to this datastore using vCenter Server. If there isn't enough free disk space you can create a new VM on the "2MB" datastore and leave the virtual disks on the "1MB" datastore for now. Just make sure you document this (e.g. in the VM's annotations) so you don't accidentally delete to old folder with the.vmdk files.

André

View solution in original post

12 Replies
a_p_
Leadership
Leadership
Jump to solution

Welcome to the Community,

which version of ESX/ESXi do you use and - in case of ESX/ESXi 4.1 or older - does the datastore you specified for the snapshots have the appropriate block size? If the error shows up in the VM's vmware.log, please attach this file to your next post.

André

0 Kudos
TurboBG
Contributor
Contributor
Jump to solution

VMware ESXi, 4.0.0, 398348

The block size on the two datastores are different.  The one that houses the VM is 1MB, and the one I plan to keep snapshots on is 2MB.  I'm not sure if this answers the question though.  How do I determine if they're appropriate?  Would they need to be the same?

I'm not familiar with how to read the vmware.log files, but I was able to find the error message in the one I attached.  I'll keep checking the others and post anything I find.

Thanks for responding Smiley Happy

0 Kudos
a_p_
Leadership
Leadership
Jump to solution

I'm not 100% sure, but I don't think the larger block size is causing the issue. Since the workingdir's block size is larger than the one of of the current virtual disk's datastore this should be ok. Does the VM currently have any active snapshots? If possible please attach the current (modified) .vmx file.

André

0 Kudos
TurboBG
Contributor
Contributor
Jump to solution

It has snapshots, but I don't know if they're active.  This is because of the initial problem that caused all of this.  I was reallocating resources, and I didn't leave enough space on the hard disk for this VM to create snapshots.  I allocated the maximum to it.  I'm chalking this up to ignorance.  I've read that you can increase the provisioned size but not decrease it (I read this after).  This is why I'm trying to change the location of my snapshots.  This will be a temporary fix until I have the opportunity to move the entire VM to the 2MB datastore.

I created this problem:

"Creating a snapshot for a virtual machine fails with the error: File is larger than maximum file size supported"

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=101238...

I attached the .vmx file with the workingDir modification in it.

0 Kudos
a_p_
Leadership
Leadership
Jump to solution

The settings don't seem to be wrong!? Please double check the host can see/access the new snapshot folder by running

cd /vmfs/volumes/4cb6d8b0-45f1b122-3a3a-d48564535eca/vmsnapshots

on the console or through SSH.

Btw. what's the size of the datastore you redirect the snapshots to?

André

TurboBG
Contributor
Contributor
Jump to solution

André, sorry for the delayed response.

The size of the datastore I want to store snapshots on is 838GB (465.39GB Free).  This will be the first VM that I redirect snapshots for though.  All of my other VMs store them in the default location.

It's going to take me some time to determine whether or not the host can see/access the new folder.  I don't have SSH configured, and I can't find a console for the host.  I'm looking into it.

I'll update this post as soon as I have some more information.  Thanks for the help. Smiley Happy

0 Kudos
TurboBG
Contributor
Contributor
Jump to solution

André,

I'm confident now that the issue is related to permissions like you suggested.  I was still unable to locate the host console, so I created the vmsnapshots directory on the 1MB datastore where the VM is located.  I still have some space outside of what is provisioned to the VM.  I redirected my .vmx to create the working directory there.  The VM booted up with no problems, but I am still unable to create snapshots.  I have 100GB of free space on this datastore, and it still gives me the same error message about not having enough space.

Any advice on how I can change the permissions so that I can create the snapshots directory on the second datastore?

Also, any ideas on why I would not be able to create snapshots on the same datastore?  I'm not sure how my snapshots are not fitting in the 100 gigs that are available.

0 Kudos
a_p_
Leadership
Leadership
Jump to solution

Actually there are no permissions on VMFS datastores, it's only the correct path you may need to verify. The reason you cannot create a snapshot on the 1 MB datastore is most likely the size of the virtual disk (>254GB). Another option than adding the workingDir would be to remove the VM from the inventory and create a new VM on the 2MB datastore using the existing .vmdk file rather than to create a new one. With ESXi 4.x snapshots are created in the VM's base folder by default so this should work without any manual modifications. Due to the newly created VM (new MAC address) you may need to adjust the network settings within the VM.

André

TurboBG
Contributor
Contributor
Jump to solution

For the new VM to use the existing .vmdk(s) (there are two).  Would I just place the .vmdk in the base folder of the new VM after I create it?

0 Kudos
a_p_
Leadership
Leadership
Jump to solution

Would I just place the .vmdk in the base folder of the new VM after I create it?

From what I understood so far, there's not enough free disk space on the "2MB" datastore to host the VM!? If there is enough free disk space then you can just migrate the VM to this datastore using vCenter Server. If there isn't enough free disk space you can create a new VM on the "2MB" datastore and leave the virtual disks on the "1MB" datastore for now. Just make sure you document this (e.g. in the VM's annotations) so you don't accidentally delete to old folder with the.vmdk files.

André

TurboBG
Contributor
Contributor
Jump to solution

André,

Sorry for the confusion.  There is enough space on the 2MB datastore for the VM.  I went ahead and moved it over there.  Everything seems to be working.

Smiley Happy

Thanks for all the help.

0 Kudos
TurboBG
Contributor
Contributor
Jump to solution

Also, incase someone stumbles across this thread, someone mentioned to me that the reason I couldn't create the snapshots on the 2MB datastore (in the vmsnapshots folder) is because I never bounced that host after making the changes to the .vmx.  I'm not sure if this is accurate because I didn't test it.  It seems worth trying.

0 Kudos