I figured out how to post files 🙂 Copy these 3 files to the same directory. These Scripts are meant to be run from the VM that you wish to mount the vmdk file to that you are backing up. I have them setup to run as a Pre and Post command in Networker so that I can run an EOM backup to tape for a 1 year retention of the data. The pre script will create a FlexClone from the SMVI snapshot, mount that Snapshot to each of the ESX hosts that are in the cluster of the current Vm running the script, adds the VMDK file to the VM, and then Mounts the new drive to the specified NTFS Mount folder. The Post script will then Unmount the drive from the host, remove the .vmdk from the VM, remove the datastore from the ESX hosts in the cluster, then delete the flexclone that was created. For extended help on running these commands, please run 'get-help .\SMVI_Mount_Pre.ps1 -Full' and 'get-help .\SMVI_Mount_Post.ps1 -Full'. If you have any questions, comments, issues, or if you found these scripts helpful, please feel free to e-mail me at Burdzy@Gmail.com. If there is enough interest, I can go into more detail on what exactly the script is doing, etc., and add some more comments to the scripts. I only had a week to get them done, so I skimped on the comments to save time.
Basic examples of running the script(s):
.\SMVI_Mount_Pre.ps1 -NAFilerIP 158.228.1.2 -NAVolume SMVI_test_Volume -SMVIJobName SMVIBackup01 -VMVCenter VirtualCenter01 -VMDKPath "smvit01/smvit01_1.vmdk" -BackupMountPoint "C:\BackupMounts\smvit01\" -Pause
.\SMVI_Mount_Post.ps1 -NAFilerIP 158.228.1.2 -NAVolume SMVI_test_Volume -SMVIJobName SMVIBackup01 -VMVCenter VirtualCenter01 -VMDKPath "smvit01/smvit01_1.vmdk" -BackupMountPoint "C:\BackupMounts\smvit01\" -Pause
In these examples
158.228.1.2 is the IP address of the NetApp Filer
SMVI_test_Volume is the name of the volume on the NetApp that is being backed up
SMVIBackup01 is the name of the Backup Job. SMVI uses this value to name it's SnapShots
VirtualCenter01 is the name of the Virtual Center that the Current VM Lives in. This is needed to run the PowerCLI commands against for the datastore and VM configuration
smvit01/smvit01_1.vmdk is the path to the actual VMDK file within the datastore that is being backed up.
C:\BackupMounts\smvit01\ is the path to the folder that you would like to mount the Drive to on the VM.
-Pause is a switch that will tell the script to pause before executing each command in case you wanted to follow along and validate that each step works correctly.
VM Host Prerequisites:
- the DataONTap powershell module MUST be installed to configure the NetApp filer
- VMWare PowerCLI module MUST be installed to configure the Virtual Machine and ESX hosts.
- SMVIFunctions.ps1 must be in the same folder as the scripts.
- Please add NetApp user credentials for account that will be running the Script using the following command to prevent having to hardcode usernames/passwords inside the script
Add-NaCredential -Controller 158.228.1.2 -Credential UserAccount - Run the script as an account that has Virtual Center privileges to prevent being prompted for a password for silent execution.