Hi Kaustav,IHMO, the `attachment` variable is an instance of DiskAttachment, instead of the type of DiskAttachmentService as expected. You should probably replace```python# Line 18-20if attachment:attachment.remove(detach_only=False)print("Disk removed")```with```pythonif attachment:attachment_service = disk_attachments_service.attachment_service(attachment.id)attachment_service.remove(detach_only=False)print("Disk removed")```On Fri, Apr 26, 2019 at 4:36 PM Kaustav Majumder <kmajumde@redhat.com> wrote:_______________________________________________Hi,
I am trying to detach and delete disk from my vm. I found this service in the docs
DiskAttachmentService
http://ovirt.github.io/ovirt-engine-sdk/master/services.m.html#ovirtsdk4.services.DiskAttachmentService
I am not able to fetch this service. Below if the snippet of code I am trying.
https://pastebin.com/UUu0Pfc8Error--> File "./pre_setup/delete_vm_disk.py", line 19, in remove_attached_vm_diskattachment.remove(detach_only=False)AttributeError: 'DiskAttachment' object has no attribute 'remove'--Thanks,
Kaustav Majumder
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-leave@ovirt.org
Privacy Statement: https://www.ovirt.org/site/privacy-policy/
oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/
List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/O4ZC47JHLBDEHF7ZE27P7AZI2DZ44E4Z/
Thanks,
Kaustav Majumder