你好,
登录到棱镜后,我打开API参考并登录信誉。
然后,我转到VM->克隆部分通过API到克隆VM。
我通过两种方法获得VM UUID,我认为我会得到同样的uuid
1)SSH到CVM并给出“ ACLI VM.LIST”
2)当控制台URL时,使用uuid =“字符串”
两者都有相同的uuid。因此,我曾经通过API克隆VM,但我会遇到错误作为“
给定的输入无效。无法指定VM UUID,使用IDEMPOTENCE标识符获取UUID
透明
我还尝试了存在并创建新的IDEMPOTENCE标识符,但是在克隆VM中执行它时,它给出了“不存在UUID”的错误。
请建议我,我认为UUID是正确的,但是是什么导致错误。
请帮忙。
最好的答案Anishwalia20
\u00a0<\/p>
Using the above POST method you can get the idempotence identifier<\/strong> of the VM.\u00a0<\/p> Also as the above documentation suggests\u00a0It is mandatory to provide the count for how many identifiers we need and the lifetime until we can use it in the POST \u201c\/idempotence_identifiers<\/strong>\u201d\u00a0API.\u00a0<\/p> Below is an example with CURL: anish.singhwalia@C02XF4HA:~$ curl -k -X POST --header \"Content-Type: application\/json\" --header\u00a0<\/p> \"Accept: application\/json\" --header \"Authorization: Basic AYWtrr7y23TnV0YW5peC8\" -d \"{ \u00a0<\/p> Now we can check the above task details\u00a0and identify the UUID of the cloned VM: \u00a0<\/p> I hope the above clarifies the procedure and helps you\u00a0 Let me know if you need anything else.<\/p> \u00a0<\/p>","className":"post__content__best_answer"}">
\u00a0<\/p>
\\\"count\\\": 1,
\\\"valid_duration_in_minutes\\\": 527040
}\" \"https:\/\/10.136.107.69:9440\/api\/nutanix\/v3\/idempotence_identifiers\"
{\"client_identifier\": null, \"count\": 1, \"expiration_time\": \"2020-12-23T07:59:57Z\", \"uuid_list\": [\"a1d6b81b-a76c-495c-9a71-508167f810dd<\/strong>\"]}<\/p>
We can use now the returned idempotence identifier(a1d6b81b-a76c-495c-9a71-508167f810dd<\/strong>) in the \/clone API<\/strong>
anish.singhwalia@C02XF4HA::~$ curl -k -X POST --header \"Content-Type: application\/json\" --header \"Accept: application\/json\" --header \"Authorization: Basic AYWtrr7y23TnV0YW5peC8\" -d \"{
\\\"metadata\\\": {
\\\"uuid\\\": \\\"a1d6b81b-a76c-495c-9a71-508167f810dd<\/strong>\\\"
}
}\" \"https:\/\/10.136.107.69:9440\/api\/nutanix\/v3\/vms\/9276242d-34r1-69f3-dfe8-5d1cb15569k2\/clone<\/a>\"
{\"task_uuid\": \"9bb26a3e-18cf-4fea-941a-cfe5e542c076<\/strong>\"}<\/p>
anish.singhwalia@C02XF4HA:~$ curl -k -X GET --header \"Accept: application\/json\" --header \"Authorization: Basic AYWtrr7y23TnV0YW5peC8\" \"https:\/\/10.136.10769:9440\/api\/nutanix\/v3\/tasks\/9bb26a3e-18cf-4fea-941a-cfe5e542c076<\/a>\"
{\"status\": \"SUCCEEDED\", \"last_update_time\": \"2019-12-23T08:01:31Z\", \"logical_timestamp\": 2, \"entity_reference_list\": [{\"kind\": \"vm\", \"uuid\": \"a1d6b81b-a76c-495c-9a71-508167f810dd<\/strong>\"}], \"start_time\": \"2019-12-23T08:01:18Z\", \"creation_time\": \"2019-12-23T08:01:18Z\", \"start_time_usecs\": 1577088078927590, \"cluster_reference\": {\"kind\": \"cluster\", \"uuid\": \"r4fd3d69-3df4-5g3d-448e-6b9312655365<\/strong>\"}, \"subtask_reference_list\": [], \"completion_time\": \"2019-12-23T08:01:31Z\", \"creation_time_usecs\": 1577088078874113, \"progress_message\": \"//www.jhbzcj.com/next/prism-for-infra-and-it-ops-26/\", \"operation_type\": \"ProcessVmClone\", \"completion_time_usecs\": 1577088091347015, \"percentage_complete\": 100, \"api_version\": \"3.1\", \"uuid\": \"9bb26a3e-18cf-4fea-941a-cfe5e542c076<\/strong>\"}<\/p>