I mapped the NFS volume to vCenter and tried to register the VM using the PowerCLI command New-VM with a pointer to the VMX file on the NFS datastore, but I get the error message "Insufficient permission to access the file". From the error message looks like my account doesn't have privileges in VMware but if I log into vCenter Web UI with the same account I'm using with PowerCLi I'm able to browse the NFS datastore and register the same VM from the VMX file.
This PowerCLI script worked fine in the past, and not it throwing errors, Does anybody know if the account used to run the PowerCLI script need to have some specific privileges to register VM? Is there any additional ESXi/vCenter log that can provide more information about the error?
Thanks
Did you check you only have a vCenter connection open?
What is in $global:defaultviservers
You can check the vpxd.log on the VCSA for additional info.
Do you have the Administartor role in that permission?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
There was no open connection, the script crashed on the first run. Regarding permissions, we only get an error if we try to do it from a script. If we map the data store to the vCenter from the script and then switch to the vCenter web interface, we can manually register the VM from the VMX file. Only if we try the New-VM command from PowerCLI which references the same VMX file we used in the manual step it fails with an insufficient permission error. For all tests, we are using the same vCentr account like "administrator@vsphere.locl".
Any info in the vpxd log (on the VCSA)?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I was unable to retrieve the log yet because this is not my VMware environment. If I manage to check the logs tomorrow will update you.
In the VPXD.LOG I found the following:
--> key = "msg.fileio.noPerm",
--> message = "Insufficient permission to access the file"
Strange.
Can you register a VMX file on another datastore (non-NFS)?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Cannot migrate that VM to another datastore because this is part of the NetApp SnapMirror replication process on the DR site. We just create a snapshot from replicated volume and present this snapshot to the VMware vCenter.
This is why It should work from that NFS, and weird is that I can register/unregister VM from the VMX file from that particular NFS if I do it from the vCenter web interface. It only fails if I try to register a VM from a VMX file using the PowerCLi New-VM command.
Before the NetApp storage is upgraded to version 9.11 P7 all worked fine, so this could be a reason but as I mentioned earlier manual registration from vCenter Web UI works without any problem and this tells me that upgrading to P7 shouldn't be an issue. Looks like we will need to open a case with VMware.
Perhaps also one with NetApp?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
The problem with NetApp is that I don't know what to tell them (except upgrade to version P7) because everything works fine from the VMware vCenter web interface. Anyway, thanks for the suggestions, we'll see first what VMware support will find.
Just to update, the issue was on NetApp's side, not VMware's. A new feature called "Native FPolicy" caused these strange situations. Anyway, now everything is fine.
