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

fix: (IAC-1091) Prevent Jump VM cloud-init from overwriting existing file permissions/ownership #189

Merged
merged 2 commits into from
Aug 4, 2023

Conversation

jarpat
Copy link
Contributor

@jarpat jarpat commented Jul 17, 2023

Changes:

When a new jump server vm is created, it sets file ownership and permissions for the mounted NFS location which allows Viya services to initialize successfully. Importantly, the file system settings should only be applied once and not repeatedly in the event that the jump vm is destroyed and recreated in the same cluster. This change checks if the ${jump_rwx_filestore_path}/pvs folder already exists and skips creating the folder and recursively setting ownerships and permissions if it does. If the jump vm is being created for the first time when the pvs folder is absent, creating the folder and setting permissions and ownership will occur an initial time and not thereafter.

Tests:

Executed the following workflow to verify that file permissions and ownership was not modified on Jump VM recreation

Steps:

  • Created cluster using viya4-iac-gcp
  • Verify infrastructure created successfully
    • Checked initial permissions and ownership of files of mounted files system on Jump VM
  • Deploy Viya4 using DaC
  • Verify Viya deployment is stabilized
    • Checked permissions and ownership of files mounted on the Jump VM that were created by the Viya deployment
  • Stop Viya. Stop a SAS Viya Platform Deployment
  • Verify all pods are terminated
  • Replace jump server vm using terraform replace command (Alternative to destroy and create), verified that the existing jump vm is destroyed and a new one is created.
  • Start Viya Start a SAS Viya Platform Deployment
  • Check deployment/pods status verify all Viya pods, services and applications stabilize and are accessible.
    • Checked that permissions and ownership of files mounted on the Jump VM that were created by the Viya deployment were not changed upon the rerun of the cloud init script.

@jarpat jarpat added the bug Something isn't working label Jul 17, 2023
@jarpat jarpat self-assigned this Jul 17, 2023
Copy link
Member

@thpang thpang left a comment

Choose a reason for hiding this comment

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

This is fine and I know we recently did this for one of the other providers, we now have to ensure that if this directory exists that we document that on its initial run the permissions need to be set to 777 and the owner/group needs to be modified as nobody:nogroup as we now cannot guarantee this. So doc will be needed here and in the other provider or providers we've updated with this code check.

@jarpat
Copy link
Contributor Author

jarpat commented Jul 18, 2023

This is fine and I know we recently did this for one of the other providers, we now have to ensure that if this directory exists that we document that on its initial run the permissions need to be set to 777 and the owner/group needs to be modified as nobody:nogroup as we now cannot guarantee this. So doc will be needed here and in the other provider or providers we've updated with this code check.

Hey @thpang, on this line in the cloud-init https://github.com/sassoftware/viya4-iac-gcp/blob/IAC-1091/files/cloud-init/jump/cloud-config#L34 we document the new functionality. Would making this section a bit more verbose to describe the updated behavior more clearly be what you are looking for?

@jarpat jarpat merged commit 47068cb into staging Aug 4, 2023
3 checks passed
@jarpat jarpat deleted the IAC-1091 branch August 4, 2023 17:51
@jarpat jarpat mentioned this pull request Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants