oVirt / python-ovirt-engine-sdk4

Python SDK for version 4 of the oVirt Engine API
Apache License 2.0
15 stars 25 forks source link

Add delete_disks.py example #73

Closed sleviim closed 2 years ago

sleviim commented 2 years ago

This example deletes disks from a storage domain based on their description. The default description matches the description added by the add_disks.py example, so this example can be used to clean up after running add_disks.py.

The script shows how to delete a massive number of disks, by submitting many remove disk requests one after the other.

nirs commented 2 years ago

This example deletes quickly disks from a given storage domain, after creating them using the 'add_disks.py' example, based on their unique description of 'Created by add_disks.py'. The script runs over the specified storage domain, and deletes the disks with the mentioned description. This one is useful after creating a great amount of disks using the script.

Suggested commit message:

This example deletes disks from a storage domain based on their description.

The default description matches the description added by the add_disks.py
example, so this example can be used to cleaning up after running add_disks.py.

The scripts shows how to perform slow operations like deleting a disk quickly,
by submitting many remove disk requests without waiting until the disk is
removed, and then waiting until all disks are removed.

It is interesting to know how this performs compared with a version waiting for every disk before removing the next disk. We don't need to test 5000 disks, testing 50 disks should be enough to show very clear difference.

sleviim commented 2 years ago

It is interesting to know how this performs compared with a version waiting for every disk before removing the next disk. We > don't need to test 5000 disks, testing 50 disks should be enough to show very clear difference.

do you mean by measuring times? I didn't get your point :)

nirs commented 2 years ago

It is interesting to know how this performs compared with a version waiting for every disk before removing the next disk. We > don't need to test 5000 disks, testing 50 disks should be enough to show very clear difference.

do you mean by measuring times? I didn't get your point :)

Yes, you wrote "quickly", so I guess you have some info about that.

sleviim commented 2 years ago

Yes, you wrote "quickly", so I guess you have some info about that.

I think it doesn't worth the effort. I can change it to 'efficiently' or 'easily' to make a point of "here's a script so you won't need to delete 5000 disks manually after you used another script to create them".

nirs commented 2 years ago

This example deletes quickly disks from a given storage domain, after

We don't delete "quickly" now. If we wanted to do this quicker, we could open multiple connections to engine and submit the delete requests in parallel, but I don't think it worth the effort, the current script is quick enough.

sleviim commented 2 years ago

We don't delete "quickly" now. If we wanted to do this quicker, we could open multiple connections to engine and submit the delete requests in parallel, but I don't think it worth the effort, the current script is quick enough.

I've changed the commit message - unlike gerrit, it now should be changed manually.

sleviim commented 2 years ago

Clean!

is it good feedback? or something is missing?

aesteve-rh commented 2 years ago

is it good feedback? or something is missing?

It is good feedback, comes with an approval! :)

sleviim commented 2 years ago

@oliel @mnecas got Nir's and Albert's approval, one more is needed :)