5 Essential Tips for Maximizing Your Experience at Nutanix .NEXT for Bloggers
I am working on converting my scripts to Powershell 7.x. I tried to use the Nutanix cmdlets 2.0.1 provided for Prism Central. Attempting to connect to Prism Central is failing. Six months ago I played around with it and it worked then but now does not.Our main Prism Central instance is pc.2023.1.0.2. We also have a test instance which is pc.2023.4. I get the same error when attempting to connect to either.PS H:\Scripts\Nutanix> Connect-PrismCentral -Server MLBPRISMTST1.cs.myharris.net -Credential $AdminCred -AcceptInvalidSSLCertsConnect-PrismCentral: Error from MLBPRISMTST1.cs.myharris.net: Could not connect. Please make sure to the remote server is Prism Central.PS H:\Scripts\Nutanix> Connect-PrismCentral -Server MLBPRISMTST1.cs.myharris.net -Credential $AdminCred -AcceptInvalidSSLCerts -ForcedConnectionConnect-PrismCentral: Error from MLBPRISMTST1.cs.myharris.net: Could not connect. Please make sure to the remote server is Prism Central.I am not encouraged by the Reddit post I
I find that I am stuck between a rock and a hard place all of a sudden. I have been using the original Nutanix PowerShell cmdlets (Add-PSSnapin NutanixCmdletsPSSnapin) for weekly inventory scripts. I also have a script for deploying new VMs from images that use these cmdlets. Our production Prism Central is pc.2022.6.0.3 and I can still login to that just fine (Connect-NTNXCluster). However, we are having numerous issues with that build and support has advised they have been resolved in the newest build pc.2023.1.0.1. We have a test Prism Central instance with one test AHV cluster. Yesterday we updated that to pc.2023.1.0.1 and now I cannot connect with the cmdlets. Scripts> Connect-NTNXCluster -Server $PCentral -Username $MyCreds.Username -Password $MyCreds.Password -AcceptInvalidSSLCerts -ForcedConnectionConnect-NTNXCluster : Invalid JSON primitive: Authentication.At line:1 char:1+ Connect-NTNXCluster -Server $PCentral -Username $MyCreds.Username -Pa ...+ ~~~~~~~~~~~~~~~~~~~~~~
We have several AHV clusters across the WANscape all managed from Prism Central. On one AHV cluster, I created a Windows Server 2016 and a Windows Server 2019 VM from CD ISOs, patched and tweaked and these are our “Golden Images”. I clone those and run sysprep and those are what I make new VMs from. Now I have two problems: 1.) in each cluster we have an RF2 container and an RF3 container so these VMs are bound to one or the other, and 2.) how do I get these to other clusters? To address the differing containers, I end up using the image service (create image of the disks and create new VM from those disks). But now I’m wasting storage because I’m keeping copies of the same VM on two different containers. To address the differing clusters, I was thinking about setting up Protection Domains and letting Nutanix replicate them to each cluster. They would only get updated once or twice per month for Windows patches. Doing it this way would allow me to control replication schedule a
I’m running into an issue with my script to deploy and setup a new VM in AHV. The part to check for and install Windows Patches can take a while and sometimes I come out of that routine and I’m no longer connected to Prism Element. I connect with Connect-NTNXCluster… I’ve seen where you can use $TestConnect = Get-NutanixCluster and then check the .IsConnected parameter. However in my testing, I last connected yesterday and when I run that this morning it still shows .IsConnected = True so it doesn’t seem like it gets updated. I’ve also changed the Prism Element GUI settings to a 2 hour timeout but still seems like after way less than that I am no longer connected. Does that apply to script connections as well? What is a good/reliable way to test if I'm still connected (outside of trying a command and catching the “unauthorized” error)? Thanks!
I have an AHV VM that I would like to disconnect the NIC and connect the NIC in my script. I need it disconnected while sysprep runs and sets a static IP address then I’m good to connect the NIC again. (Otherwise it pulls a DHCP address and replaced the hostname with the DHCP address in DNS). I can Get-NTNXVMNIC and see the current status of the NIC but I don’t see a way to change the status (i.e. I don’t find a Set-NTNXVMNIC command). Thanks! -TimG
Already have an account? Login
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
Sorry, our virus scanner detected that this file isn't safe to download.