Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1067115 - Python SDK New Example (Detach a disk from a VM)
Summary: Python SDK New Example (Detach a disk from a VM)
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: Documentation
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Andrew Dahms
QA Contact: Laura Novich
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-19 17:59 UTC by Dave Johnson
Modified: 2016-01-27 01:58 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Build Name: 12978, Developer Guide-3.3-1 Build Date: 09-01-2014 10:14:45 Topic ID: 9228-568768 [Latest]
Last Closed: 2014-07-30 12:26:56 UTC
oVirt Team: ---


Attachments (Terms of Use)

Description Dave Johnson 2014-02-19 17:59:27 UTC
Title: Python New Example (Detach a disk from a VM)

Describe the issue:
=====================
Basically I have a direct_lun disk shared between multiple VMs.  I ran into a issue where deleting the VM deleted the entire direct_lun disk removing it from all VMs using it.  The logical step was to detach the disk but the disk object doesn't have a .detach() or .remove()... only delete which deletes it everywhere.

After a bunch of digging, I found some help with how to do this and believe it should be added as a example.

# Find the VM:
vm = api.vms.get(name="myvm")
disk = vm.disks.get(name="mylun")
# Detach the disk:
detach = ovirtsdk.xml.params.Action(detach=True)
disk.delete(action=detach)

Comment 2 Andrew Dahms 2014-07-24 08:08:33 UTC
Documentation Link
------------------------------
https://documentation-devel.engineering.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Virtualization/3.5-Beta/html-single/Technical_Guide/index.html#Example_Detaching_a_Disk_using_Python

What Changed
------------------------------
Added the following topic to outline how to detach a disk using the Python SDK.

Example: Detaching a Disk using Python [40943]

Updated revision history [34616-651639]

NVR
------------------------------
Red_Hat_Enterprise_Virtualization-Technical_Guide-3.5-Beta-en-US-3.5-3

Moving to ON_QA.


Note You need to log in before you can comment on or make changes to this bug.