ESXi guest OS; how to change the working directory to an NFS

Received some good instruction to solve an issues with snapshot size on a datastore with block size too small.

Have an inexpensive NAS and have successfully followed the instructions to create a Datastore on the host using the NAS NFS.

Making mistakes and not having luck in editing the VM .vmx file to add the workingDir=”"
that cuases the VM to use the NFS target as the snaphot datastore.  The path to the NFS is eluding me.  The NFS store is just a temporary fix to aid other issues

Creating the NAS datastore seemed to go well and simple.  The Datastore name is NAME and the path to the store is ip,ip.ip.ip:/nfs/store.  

How to code the .vmx to use workingDir=”ip,ip.ip.ip:/nfs/store" and does there need to be an additional folder inside the store, that is called out in the path?
VirtualDallasAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization ConsultantCommented:
The first issue that you may have here, is the VMX sometimes can be cached by vCenter, which means, for you, you may have to turn off the VM, and remove the VM from the inventory, and then edit the VMX file and then Add the VM back to the Inventory for Changes to Take Effect.

add a line at the bottom of the VMX file as follows

workingDir = "new_path_location"

I would recommend creating a folder on the NAS called vm-snapshots

workingDir = "/vmfs/volumes/46f1225f-552b0069-e03b-00145e808070/vm-snapshots"

you then need to find the unique GUUID for the NAS datastore.

you can find these easily at the command prompt or use vSphere Client and look at Inventory Datastores

Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization ConsultantCommented:
at the command prompt, on the ESXi server type

ls -al /vmfs/volumes

you will see the friendly name symlinked to the GUUID (the long number this is what you want to use)

e.g. for me it's this

 nfs -> eff44beb-2c974ed7

we want to use the GUUID because it NEVER changes, and friendly name is for us humans!
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization ConsultantCommented:
and another tip it's only when you create the snapshot, you will see in the Summary Page for the VM, it will be using two datastores.

and you can test this, with using Snapshot Manager, no need to wait for Backup to start.
CEOs need to know what they should worry about

Nearly every week during the past few years has featured a headline about the latest data breach, malware attack, ransomware demand, or unrecoverable corporate data loss. Those stories are frequently followed by news that the CEOs at those companies were forced to resign.

VirtualDallasAuthor Commented:
Thought so; and have removed, edited and added vm to host inventory.  Issue is do not see GUID in datastore name, as in other datastores.  The store is listed and browsable in client, right down to the folder I added.  But name in the vSphere client inventory is simply ip.ip.ip:/nfs/Store
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization ConsultantCommented:
did you give the datastore a name?

and if you look at

ls -al /vmfs/volumes

it must be there?
JavierLopezMCPCommented:
1st No.. there doesn't need to be a folder with the nfs store.. each VM will create a folder called "VM Name" and place the snap shot with it. BUT to keep your sanity you may want to create a folder in case you use this LUN for something else in the future.. Its just good practice to keep organized.

Here is how I set my snapshot redirection

using the vsphere powerCLI


Connect-VIServer "vCenterServerName"

$vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
$vmConfigSpec.Files = New-Object VMware.Vim.VirtualMachineFileInfo
$vmConfigSpec.Files.snapshotDirectory = "[DataStore01] \VmSnapShotFolder"

$vm = Get-VM Server01 | Get-View
$vm.ReconfigVM($vmConfigSpec)

$vm = Get-VM Server02 | Get-View
$vm.ReconfigVM($vmConfigSpec)

$vm = Get-VM Server03 | Get-View
$vm.ReconfigVM($vmConfigSpec)

DONE

the [DataStore01] in the command above is simply what you called the LUN in vCenter when you imported it.. and the \VmSnapShotFolder is the folder that is in the [DataStore01] Lun you created to store your snapshots.

This script above is very simple and does exactly what you want.. it adds the workingDir line in the VMX file and sets it correctly. Once complete I would power off and on the VM and create a snapshot to test it.


Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization ConsultantCommented:
I only see ip.ip.ip:/nfs/Store when I look at Storage, and that's the device.
VirtualDallasAuthor Commented:
yes, gave it a name; embarssing but never cli and putty doesnt seem to want to
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization ConsultantCommented:
when you added the nfs storage, did you give it a friendly name?

can you rename the ip.ip.ip:/nfs/Store ?
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization ConsultantCommented:
what's the server ESXi 4.1?
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization ConsultantCommented:
if you click Inventory, Datastores? does it list ALL your Datastores?
VirtualDallasAuthor Commented:
I can rename; in the storage inventory the device has a name (nasstore) and the "device" column  has listed as ip/ip.ip.ip:/nfs/nfsfoldername
VirtualDallasAuthor Commented:
yes esxi 4.1 and yes all datastores are listed, nfs store is browsable
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization ConsultantCommented:
DS
what does yours look like?
VirtualDallasAuthor Commented:
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization ConsultantCommented:
yes, this is the wrong place!!!!!

Click Home > Inventory > Datastores

Home is almost Top Left!

Are you connected to vCenter of the Client?
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization ConsultantCommented:
sorry, connected to vCenter or direct to the ESXi server?
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization ConsultantCommented:
you'll not have datastores if connected direct to the server using vSpere Client.

you will have to go to the SSH remote or console.
VirtualDallasAuthor Commented:
no vCenter here, yet and SSH not behaving?  Crud, sorry...
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization ConsultantCommented:
your friiendly name for the datastore is called

IomegaNAS

so when you look at the results to

ls -al /vmfs/volumes

IomegaNAS ---> xxxxxxxxxxxxxxxxxxxxxxxxxx

the xs above are the GUUID
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization ConsultantCommented:
Select Configuration, Security Profile, Services (Properties) at the Top, SSH Options Start, ESXi Shell Options Start
VirtualDallasAuthor Commented:
ha; got ssh running
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization ConsultantCommented:
actually at the top Service Prioperties

and then

SSH > Options > Start,
ESXi > Shell Options > Start

and then try putty
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization ConsultantCommented:
once logged in.....

type ls -al /vmfs/volumes

you can use putty to copy the GUUID name......

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
VirtualDallasAuthor Commented:
close; got guuid
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization ConsultantCommented:
so just work that GUUID into the VMX and you should be done.
VirtualDallasAuthor Commented:
Thank you; I feel so small, yet so happy!  Now onto the bigger issues.  Probably not until this weekend.  Thank you honestly for your patience.  Best personal regards...
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization ConsultantCommented:
No problems.

Just a small tip, because I do not know, how good the NAS performance will be, but when in snapshot mode, all the realtime writes will go to this delta virtual machine disk on the NAS.

NFS, NAS, Network could possible cause performance issues, so make sure the Backup/Veeam/Snapshot is completed at a quiet time, so the snapshot size is small.......

also DO NOT resize a disk with a snapshot, and becareful as well on the size, otherwise you could get issues, on closure of snapshot, when it writes and merges the changes from the NAS back to local disk.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Storage Software

From novice to tech pro — start learning today.