Task 10
An administrator is working to create a VM using Nutanix V3 API calls with the following specifications.
* VM specifications:

* vCPUs: 2
* Memory: BGb
* Disk Size: 50Gb
* Cluster: Cluster A
* Network: default- net
The API call is falling, indicating an issue with the payload:
The body is saved in Desktop/ Files/API_Create_VM,text
Correct any issues in the text file that would prevent from creating the VM. Also ensure the VM will be created as speeded and make sure it is saved for re-use using that filename.
Deploy the vm through the API
Note: Do not power on the VM.
Answer : A
https://portal.nutanix.com/page/documents/kbs/details?targetId=kA00e000000LLEzCAO
https://jsonformatter.curiousconcept.com/#
acli net.list (uuid network defult_net)
ncli cluster info (uuid cluster)
Put Call: https://Prism Central IP address : 9440/api/nutanix/v3vms
Edit these lines to fix the API call, do not add new lines or copy lines.
You can test using the Prism Element API explorer or PostMan
Body:
{
{
'spec': {
'name': 'Test_Deploy',
'resources': {
'power_state':'OFF',
'num_vcpus_per_socket': ,
'num_sockets': 1,
'memory_size_mib': 8192,
'disk_list': [
{
'disk_size_mib': 51200,
'device_properties': {
'device_type':'DISK'
}
},
{
'device_properties': {
'device_type':'CDROM'
}
}
],
'nic_list':[
{
'nic_type': 'NORMAL_NIC',
'is_connected': true,
'ip_endpoint_list': [
{
'ip_type': 'DHCP'
}
],
'subnet_reference': {
'kind': 'subnet',
'name': 'default_net',
'uuid': '00000000-0000-0000-0000-000000000000'
}
}
],
},
'cluster_reference': {
'kind': 'cluster',
'name': 'NTNXDemo',
'uuid': '00000000-0000-0000-0000-000000000000'
}
},
'api_version': '3.1.0',
'metadata': {
'kind': 'vm'
}
}
https://www.nutanix.dev/2019/08/26/post-a-package-building-your-first-nutanix-rest-api-post-request/
Reference