Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
curl --request POST \
  'https://{{api_domain}}/v1/{{location_slug}}/user-resource/admin/vm/storage/detach' \
  --header 'apikey: meowmeowmeow' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'uuid=08ff1c8c-6da5-4351-98fe-2c8a4a76817a' \
  --data-urlencode 'storage_uuid=09e66ce4-5e29-480a-ad21-65f2b406e187'

Now the disk is ready to be used again.

Use it with a VM

There are two options, the disk can either be either attached to an existing VM or used as an existing a primary disk when creating a new VM.

Expand
titleCreate a new VM

...

, use the restored disk as primary boot disk

Check the admin API documentation for more information. Here’s a basic example:

Code Block
languagebash
curl --request POST \
  'https://{{api_domain}}/v1/{{location_slug}}/user-resource/admin/vm' \
  --header 'apikey: meowmeowmeow' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'user_id=35' \
  --data-urlencode 'billing_account_id=129124' \
  --data-urlencode 'os_name=centos' \
  --data-urlencode 'os_version=8.2' \
  --data-urlencode 'name=using a restored disk' \
  --data-urlencode 'ram=2048' \
  --data-urlencode 'vcpu=2' \
  --data-urlencode 'password=WhatEver1234' \
  --data-urlencode 'username=theuser' \
  --data-urlencode 'disk_uuid=09e66ce4-5e29-480a-ad21-65f2b406e187'
Expand
titleAttach the disk to an existing VM

Alternatively, attach the disk to some VM that the user already has so they can recover the data from the restored disk. Again refer to admin API documentation for more information.

Code Block
languagebash
curl --request POST \
  'https://{{api_domain}}/v1/{{location_slug}}/user-resource/admin/vm/storage/attach' \
  --header 'apikey: meowmeowmeow' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'uuid=f2f759c5-9a82-4c7a-9aec-d62be56f948e' \
  --data-urlencode 'storage_uuid=09e66ce4-5e29-480a-ad21-65f2b406e187'