VMware Cloud Community
HKWP
Contributor
Contributor

Create NFS datastore via scripting

Hi All,

I have a question regarding adding existing NFS datastores from one

cluster to another cluster via scripting.

Let me further explain my problem and settings.

Currently, there are two clusters that were built. One of them is a

nursery cluster and the other one is a production cluster. Both of the

clusters are residing in the same VC. From the nursery cluster, all VMs

are built and tested. After the process is completed, all the VMs that are

residing on the datastore are going to move into production. And the plan

is to present those datastores from the nursery cluster to the production

cluster. We are trying to automate the process presenting those

datastores from the nursery cluster to the production cluster via

scripting.

I'm very new to scripting and I want to know if anyone has any sample script

that can be modify? Also, after doing a little research, I think the

easiest way is to use the VI powershell tool kit. Any suggestions? Please provide some pointers; I really don’t

know where to start.

HKWP

0 Kudos
2 Replies
mcowger
Immortal
Immortal

VMWare Stage Manager can do all that for you....






--Matt

--Matt VCDX #52 blog.cowger.us
0 Kudos
lamw
Community Manager
Community Manager

If you're looking for a tool to continuously support this type of dynamic environment, then as stated, VMware Stage Manager is a good option.

If you're looking to just unmount and mount NFS datastore you have few options using the CLI:

1) vimsh - specifically look at the example

[vimsh|vmware-vimsh|vmware-vim-cmd] hostsvc/datastore/nas_create MY_NFS_DATASTORE 172.30.0.254 /nfs/mount/point 1

2) If you're running ESX or ESXi (though it's local console is unsupported) you can manually use esxcfg-nas command

3) You can use RCLI for either Windows/Linux or VMware's virtual appliance which has RCLI (esxcfg-nas/vicfg-nas)

=========================================================================

--William

VMware ESX/ESXi scripts and resources at:

0 Kudos