7

For example:

gcloud compute disks create --size=10GB my-data-disk

would print 2 things:

  1. Warning:

    WARNING: You have selected a disk size of under [200GB]. This may result in poor I/O performance. For more information, see: https://developers.google.com/compute/docs/disks/persistent-disks#pdperformance.
    

    This can be eliminated with --verbosity error

  2. Status:

    Created [https://www.googleapis.com/compute/v1/projects/sigma-project-12345/zones/europe-west1-c/disks/my-data-disk].
    NAME          ZONE           SIZE_GB TYPE        STATUS
    my-data-disk europe-west1-c 10      pd-standard READY
    

    This I don't know how to disable, other then redirecting stderr, which of course I don't want because I still have to see if an error happened.

The -q argument does not remove it.

Stephen Weinberg
  • 51,320
  • 14
  • 134
  • 113
Gabriel Petrovay
  • 20,476
  • 22
  • 97
  • 168

3 Answers3

12

The --no-user-output-enabled or --user-output-enabled=false flags seem to be what you are looking for.

Try this:

gcloud compute disks create --size=10GB my-data-disk --no-user-output-enabled

Vilas
  • 1,405
  • 12
  • 15
1

@Vilas's answer is correct however please note that --no-user-output-enabled broke in some cases around version 141.0. See this issue - https://issuetracker.google.com/issues/36076836

Sam Kenny
  • 395
  • 4
  • 9
  • thanks Sam, seems to have been fixed and closed in 2019, will give it a try and feedback on this page if I experience any issues for any one else who reads this – Hom Bahrani Nov 20 '20 at 05:23
0

Another option is to disable all the related warnings

import warnings
warnings.filterwarnings("ignore", "Your application has authenticated using end user credentials")
tashuhka
  • 5,028
  • 4
  • 45
  • 64