这就跟你问声好!
我想使用Prism Central API来创建vdsik并将其连接到VM。唯一的例子和主题我见过使用Prism Element API创建和附加vdisk,即使用特定的CVM作为端点。
我不想使用特定的CVM,因为这是一个由我们的ITSM系统触发的精心安排的任务。我们不能依赖特定的CVM,而更愿意使用Prism Central。
但是,我找不到任何能够创建和附加vdisk的API调用。也许PUT /vms/{uuid}调用能够做到这一点,但我在其中看不到任何提到这一点的文档.
棱镜中心有办法做到这一点吗?
最佳答案JoseNutanix
You can create and attach vdisks with Prism Central API. Here the steps you have to follow:<\/p>
- Do a GET for the VM you want to update<\/li>\t
- From the JSON payload, remove the status key completely<\/li>\t
- In the spec key, look for disk_list and add an additional item to that list (the new disk). The format is:<\/li><\/ol>
{
\"device_properties\": {
\"device_type\": \"DISK\",
\"disk_address\": {
\"adapter_type\": \"SCSI\",
\"device_index\": 3
}
},
\"disk_size_bytes\": 3221225472,
\"storage_config\": {
\"storage_container_reference\": {
\"kind\": \"storage_container\",
\"uuid\": \"c03cd780-32fa-4292-9eab-ab2f9c311328\",
\"name\": \"default-container-151523\"
}
}
}<\/code><\/pre>- Send a PUT with this payload.\u00a0<\/li><\/ol>
Please let me know if you find any issue.<\/p>","className":"post__content__best_answer"}">
- Send a PUT with this payload.\u00a0<\/li><\/ol>