5 Essential Tips for Maximizing Your Experience at Nutanix .NEXT for Bloggers
00812919
Hi Anish, I opened a support case on this. In the end the issue was the service account was a viewer in global Prism Central role mapping whilst also having with the custom role. This cause a conflict and we needed to remove Viewer to fix this.
Wow - what a great spot! It worked. Thank you so much nijezauzeto
I really appreciate the trouble you went to nijezauzeto. I’ve tried with the Open API interface and also with a REST call from PowerShell and hit the same issue - (422) Unprocessable Entity. Here is a sample of my code . . . Connect-NutanixCluster -Server $ntxCluster -UserName $cred.UserName -Password $cred.Password $vm = Get-NTNXVM | Where {$_.vmname -eq "myvirtualmachine"} | $uri = "https://$($ntxCluster):9440/PrismGateway/services/rest/v2.0/vms/$($vm.uuid)/disks/attach" $body = @" { "uuid": "$($vm.uuid))", "vm_disks": [ { "vm_disk_clone": { "disk_address": { "device_bus": "SCSI", "device_index": 0, "vmdisk_uuid": "$($vm.nutanixVirtualDiskUuids)" } } } ] } "@ $Method = "POST" $encoded = [System.Text.Encoding]::UTF8.GetBytes(($cred.UserName, $token -Join ':')) $authHeader = [System.Convert]::ToBase64String($Encoded) $headers = @{ "Content-Type" = "application/json" "Authorization" = "Basic
I gave that go but I’m missing something I’m not sure which of the disk attributes this pertains to { "message": "Disk spec must be specified"}
Thanks Alona, yes that was my initial approach. I loaded in the values including an id of a test VM to the Open API input box and chose ‘Try it Out’ I got this back . . . This might change the state of the cluster. Are you sure you want to do this operation? After seeing that message on a Friday evening on our production cluster, and being a first time Nutanix user I decided it would more prudent to see if anyone else has experience of this. I find coding examples a bit light on the ground. For example none of the PowerShell modules have any examples in the inline help. I’ll probably just have to take the leap of faith on it.
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.