We are working on a automation solution for patching through VM manager. as part of it we have a function which is scheduling the patches on VM .
but as pre requirement ,OS config agent on VM needs to be installed . which we can install remotely using command -
gcloud compute ssh "vmname" --zone=us-central1-a --command "sudo systemctl status google-osconfig-agent"
but we have few policies applied at org level -compute.disableGuestAttributesAccess is true. because of this we are not able to install the agent using command for any vm and got below error.
ERROR: (gcloud.compute.ssh) Could not fetch resource:
- Constraint constraints/compute.disableGuestAttributesAccess violated for project 'abc"
We have to do it through automation (not manually by going to VM and then install). Can you please suggest if there is any other way we can do this.
Osconfig agent is installed by default and runs in background for all GCP supported OS built after 2020 January.
Are these legacy VMs or was osconfig agent explicitly removed/terminated?