I am new to ovirt and am trying to increase the size of an already attached disk to my VM. Here is a good example for the same: Ovirt SDK example .
The only issue with this is that in this example, we are attaching the disk first and then resizing it. This way I have access to disk_attachment which is used later on to update the size. For me this is not an option as I am not attaching the disk myself as it happens automatically from the template.
//Attach disk first
disk_attachment = disk_attachments_service.add(
types.DiskAttachment(
disk=types.Disk(
name='mydisk',
description='my disk',
format=types.DiskFormat.COW,
provisioned_size=10 * 2**30,
storage_domains=[
types.StorageDomain(
name='bs-scsi-012',
),
],
),
interface=types.DiskInterface.VIRTIO,
bootable=False,
active=True,
),
)
//update
# Find the service that manages the disk attachment that was added in the
# previous step:
disk_attachment_service = disk_attachments_service.attachment_service(disk_attachment.id)
Is there a way I can get my hands at disk_attachment.id so that I can fire the update operation or is there an alternate way to achieve the same?