Why doesn't Compute VM COS metadata not get carry over to "Equivalent command line"?

118 views Asked by At

I'm deploying a container to a Container Optimized OS or COS on Google Compute.
I want to specify Logging and Monitoring for the VM. There are 2 ways to do this:

  • Specify metadata flags:

    screenshot

  • Mark the checkboxes

    screenshot

But when I then click on "Equivalent command line", there's no indication of these options.

Am I just misinterpreting something here or am I not allowed to specify these flags in the command?

I tried with the non-COS VM instance and the expected metadata flag showed up to indicate the metadata. But this does not show up in the COS command.

gcloud compute instances create instance-1 \
    ...
    --metadata=MY_TEST_FLAG=test_value 
1

There are 1 answers

0
Chandra Kiran Pasumarti On BEST ANSWER

Yes. When using container optimized OS images while creating a VM this issue is coming, But this is for command line code only. REST equivalent is generated properly, As a work around for this you can add the metadata flag to the generated command as mentioned below.

--metadata=google-logging-enabled=true,google-monitoring-enabled=true

I have raised a request on this issue. Please monitor the Google Public Issue Tracker for further updates on the fix of the issue.

In case you find any such issues in future you can report to Google using Report issues and request features with issue trackers.