3.14. 仮想ディスクの取り外し
この Ruby の例では、仮想マシンからディスクをデタッチします。
# Find the virtual machine: vm = vms_service.list(search: 'name=myvm').first # Detach the first disk from the virtual machine: vm_service = vms_service.vm_service(vm.id) attachments_service = vm_service.disk_attachments_service attachment = attachments_service.list.first # Remove the attachment. The default behavior is that the disk is detached # from the virtual machine, but not deleted from the system. If you wish to # delete the disk, change the `detach_only` parameter to `false`. attachment.remove(detach_only: true)
詳細は、VmService:disk_attachments_service を参照してください。