-
Notifications
You must be signed in to change notification settings - Fork 9
Adding vm_snapshot examples to collection #223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
domendobnikar
commented
May 3, 2023
- filter and delete based on special properties
- filter and delete based on timestamps
- filter and delete based on special properties - filter and delete based on timestamps
justinc1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor changes.
The timezone is problematic, but if it is always UTC, than we just document this.
|
We talked about adding a practical example of using uuid with vm_snapshot. @justinc1 |
justinc1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm worried get_snapshot() has small bug.
| from ..module_utils.vm import VM | ||
|
|
||
|
|
||
| def get_snapshot( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any chance to get a snapshot with correct label, but from a different VM?
It seems to me: filter to domainUUID=vm_object.uuid part is lost. And integration tests should be extended too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We pass VMobject as one of the parameters in this function.
It is then used with label for snapshot query if snapshot_uuid isn't passed as parameter to playbook.
The only added part was the if module.params["uuid"]: , everything else is the same. (code was taken from ensure_present function)
UUID is unique throughout the platform and use a different endpoint, it does not require any additional filtering by VM or label.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will extend integration tests to include the filtering by uuid part.
Good point 👍
justinc1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added integration test - OK, thank you.
I think I didn't manage to describe what was potential problem. Say we have:
- vm_a, with snapshot:
- snap_label_X, snap_uuid_a
- vm_b, with snapshot:
- snap_label_X, snap_uuid_b
Then I try to task:
vm_snaptshot:
vm_name: vm_a
snapshot_uuid: snap_uuid_b
I think this case is not covered by current integration tests. In this case, module might continue to work with snap_uuid_b, but it should fail, vm_a has no snap_uuid_b.
|
Oh okey, I misunderstood the problem. |
justinc1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ty