Permissions or ownerships have to be fixed in the environment to avoid issues.
Workaround:
Run the attached sddcmanager_fs_permission_checks.py file to validate files/directories permission and ownership.
Step 1: Login to SDDC Manager VM via SSH and switch to root
Step 2: Copy the attached python script file (sddcmanager_fs_permission_checks.py) via SCP to SDDC Manager under /home/vcf
Step 3: Set permissions for script file
cd /home/vcf
chown root:root sddcmanager_fs_permission_checks.py
chmod 750 sddcmanager_fs_permission_checks.py
Step 4: Run the python script file
python sddcmanager_fs_permission_checks.py
4a.If the script fails with a stacktrace similar to the following:
Traceback (most recent call last):
File "/opt/vmware/vcf/lcm/lcm-app/bin/sddcmanager_fs_permission_checks.py.copy", line 383, in <module>
main()
File "/opt/vmware/vcf/lcm/lcm-app/bin/sddcmanager_fs_permission_checks.py.copy", line 377, in main
checker.inspect_directories()
File "/opt/vmware/vcf/lcm/lcm-app/bin/sddcmanager_fs_permission_checks.py.copy", line 312, in inspect_directories
self.inspect_directory(path, owner)
File "/opt/vmware/vcf/lcm/lcm-app/bin/sddcmanager_fs_permission_checks.py.copy", line 307, in inspect_directory
os.path.join(dirpath, d_name), dir_owner)
File "/opt/vmware/vcf/lcm/lcm-app/bin/sddcmanager_fs_permission_checks.py.copy", line 307, in inspect_directory
os.path.join(dirpath, d_name), dir_owner)
File "/opt/vmware/vcf/lcm/lcm-app/bin/sddcmanager_fs_permission_checks.py.copy", line 307, in inspect_directory
os.path.join(dirpath, d_name), dir_owner)
[Previous line repeated 1 more time]
File "/opt/vmware/vcf/lcm/lcm-app/bin/sddcmanager_fs_permission_checks.py.copy", line 296, in inspect_directory
file_owner = self.__validate(f_path, root_owner)
File "/opt/vmware/vcf/lcm/lcm-app/bin/sddcmanager_fs_permission_checks.py.copy", line 206, in __validate
status = os.stat(path)
FileNotFoundError: [Errno 2] No such file or directory: '/opt/vmware/vcf/sddc-support/sddc-202301100925/var/log/dracut.log'
Then there is an invalid symlinked file which is causing the script to exit prematurely.
To move past this, manually create the file it is complaining about with 750 permissions:
Example command based on above stacktrace: `touch /opt/vmware/vcf/sddc-support/sddc-202301100925/var/log/dracut.log && chmod 750 /opt/vmware/vcf/sddc-support/sddc-202301100925/var/log/dracut.log`
After running the above, retry the script (i.e. retry step 4)
Step 5: Check for errors reported on the console
Example:-
Permission Error :
{'path': '/opt/vmware/vcf/commonsvcs/scripts/fips/init-fips.sh', 'message': 'owner permission bits are "r-x". Expected at the minimum "rw-"', 'remediation': 'Please make sure files under directory owned by a specific non root owner have both read and write permission'}
Ownership Error : {'path': '/var/log/vmware/vcf/lcm', 'message': 'owner is root. Expected vcf_lcm', 'remediation': 'Please make sure files under directory owned by a specific owner have the same owner unless the parent directory is owned by "root" user'}
Step 6: Based on remediation, set correct permission and ownership
Set permission example:-
chmod 750 /opt/vmware/vcf/commonsvcs/scripts/fips/init-fips.sh
Set ownership example:-
chown vcf_lcm:vcf /var/log/vmware/vcf/lcm
If above fails to provide ownership to child directories within the parent directory, then run it recursively. For example:-
chown -R vcf_lcm:vcf /opt/vmware/vcf/kcm/lcm-tools/bin
Step 7: Rerun the script (Step-4) to verify that all file/directory permission and ownership issues are resolved.