Questo contenuto non è disponibile nella lingua selezionata.
3.14. Detaching a Virtual Disk
This Ruby example detaches a disk from a virtual machine.
Find the virtual machine:
Detach the first disk from the virtual machine:
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.
# 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)
Copy to ClipboardCopied!Toggle word wrapToggle overflow
Aiutiamo gli utenti Red Hat a innovarsi e raggiungere i propri obiettivi con i nostri prodotti e servizi grazie a contenuti di cui possono fidarsi. Esplora i nostri ultimi aggiornamenti.
Rendiamo l’open source più inclusivo
Red Hat si impegna a sostituire il linguaggio problematico nel codice, nella documentazione e nelle proprietà web. Per maggiori dettagli, visita il Blog di Red Hat.
Informazioni su Red Hat
Forniamo soluzioni consolidate che rendono più semplice per le aziende lavorare su piattaforme e ambienti diversi, dal datacenter centrale all'edge della rete.