Skip to content
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

Adding protection policies and protected resources module dev&tests #591

Open
wants to merge 12 commits into
base: release/2.1
Choose a base branch
from

Conversation

abhinavbansal29
Copy link
Collaborator

@abhinavbansal29 abhinavbansal29 commented Feb 19, 2025

Protection policies and protected resources V4 modules that support these operations

  • Fetch a protected resource ( VM/VG )
  • Promote protected resource
  • Restore protected resource
  • Create protection policy with check mode
  • Create linear retention protection policy
  • Create auto retention protection policy
  • Create Synchronous replication protection policy
  • Update protection policy with check mode
  • Update linear retention protection policy
  • Test Idempotency by updating protection policy with same values
  • Update auto retention protection policy
  • List all protection policies
  • List all protection policies with filter
  • List all protection policies with limit
  • Fetch protection policy by external ID
  • Delete protection policies

Copy link
Collaborator Author

@abhinavbansal29 abhinavbansal29 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comments in Dev Code

elements: dict
required: true
suboptions:
source_location_label:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this label name means ? Can you share example ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Label of the source location from the replication locations list
It could be any unique name

- The external identifier of the category.
type: str
required: false
name:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please verify once if name, uris and entity type is required for associating categories ? What is significance of this attributes in association when external ID is enough to attach to a vg.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are not required fields and we are not using them in the tests

Copy link
Collaborator Author

@abhinavbansal29 abhinavbansal29 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comments in Test code

success_msg: "VM restored successfully"
fail_msg: "VM restore failed"

- name: Promote VG
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can we make sure till this point the VG is protected or not?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can't, there is no attribute to tell if VG is protected or not in the response that's why we added delay


- name: Generate spec for updating linear retention protection policy using check mode
nutanix.ncp.ntnx_protection_policies_v2:
ext_id: "{{ todelete[0] }}"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use direct values in check mode test cases

register: result
ignore_errors: true

- name: Status for disassociating category from first VG
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way we can check if it is disassociated or not?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants