deprecated 'sshKeys' metadata item | centos | latest guest environment already installed

When login into GCP VM from browser i get a popup saying

The VM guest environment is outdated and only supports the deprecated 'sshKeys' metadata item. Please follow the steps here to update.

A: I followed the instruction and updated the guest environment as mentioned here and run following cmds

sudo yum makecache
sudo yum install google-compute-engine google-compute-engine-oslogin \
google-guest-agent google-osconfig-agent

B: As a result, I now have the following packages

google-compute-engine-20210204.00-g1.el7.noarch 
google-compute-engine-oslogin-20210429.00-g1.el7.x86_64
google-guest-agent-20210223.01-g1.el7.x86_64 
google-osconfig-agent-20210429.3-g1.el7.x86_64 

C: Restarted the VM and still getting the same msg of The VM guest environment is outdated

What can be the issue?.
Note: I am unable to use SSHMeta feature also, as I am trying SSHKey via meta for the first time on this vm. Also, this vm was created from an image which was more than two-year old


PS: Have validated the environment as mentioned here

>>>sudo systemctl list-unit-files | grep google | grep enabled
google-accounts-manager.service               enabled 
google-address-manager.service                enabled 
google-clock-sync-manager.service             enabled 
google-guest-agent.service                    enabled 
google-osconfig-agent.service                 enabled 
google-shutdown-scripts.service               enabled 
google-startup-scripts.service                enabled 
google-oslogin-cache.timer                    enabled 

serial port console also looks ok

Installed packages are

rpm -qa --queryformat '%{NAME}\n' \
> |grep -iE google\|gce | grep -iE \
> 'google|gce'
google-compute-daemon
google-compute-engine
google-cloud-sdk
google-compute-engine-oslogin
google-guest-agent
google-osconfig-agent

I do see logs that google-agent creates /home/user-configured-in-ssh-meta

But it does not add the key under authorizedkey file


Solution 1:

Faced a similar issue while migrating an old VM. I had to remove google-compute-daemon.noarch from old vm and update the guest environment.

Also make sure that you have installed followings:

gce-disk-expand.x86_64               1:20200716.00-g1.el7                @google-cloud-compute
google-cloud-sdk.noarch              293.0.0-1                           @google-cloud-sdk
google-compute-engine.noarch         1:20210204.00-g1.el7                @google-cloud-compute
google-compute-engine-oslogin.x86_64 1:20210429.00-g1.el7                @google-cloud-compute
google-guest-agent.x86_64            1:20210223.01-g1.el7                @google-cloud-compute
google-osconfig-agent.x86_64         1:20210429.3-g1.el7                 @google-cloud-compute