• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Search

gcloud

Gcloud Table vs CSV Format

September 18, 2023

Differences using gcloud table vs CSV format.

Table format

gcloud compute snapshots list \
--filter="sourceSnapshotSchedulePolicy ~ $POLICY AND sourceDisk~$disk$" \
--format="table(sourceDisk.basename(),name,creationTimestamp,sourceSnapshotSchedulePolicy.basename())" \
--sort-by "~creationTimestamp" \
--project="$PROJECT"

gcloud compute snapshots list \ --filter="sourceSnapshotSchedulePolicy ~ $POLICY AND sourceDisk~$disk$" \ --format="table(sourceDisk.basename(),name,creationTimestamp,sourceSnapshotSchedulePolicy.basename())" \ --sort-by "~creationTimestamp" \ --project="$PROJECT"

CSV format

gcloud compute snapshots list \
--filter="sourceSnapshotSchedulePolicy ~ $POLICY AND sourceDisk~$disk$" \
--format="csv[separator=','](sourceDisk.basename(),name,creationTimestamp,sourceSnapshotSchedulePolicy.basename())" \
--sort-by "~creationTimestamp" \
--project="$PROJECT"

gcloud compute snapshots list \ --filter="sourceSnapshotSchedulePolicy ~ $POLICY AND sourceDisk~$disk$" \ --format="csv[separator=','](sourceDisk.basename(),name,creationTimestamp,sourceSnapshotSchedulePolicy.basename())" \ --sort-by "~creationTimestamp" \ --project="$PROJECT"

Output to file

gcloud compute snapshots list \
--filter="sourceSnapshotSchedulePolicy ~ $POLICY AND sourceDisk~$disk$" \
--format="csv[separator=','](sourceDisk.basename(),name,creationTimestamp,sourceSnapshotSchedulePolicy.basename())" \
--sort-by "~creationTimestamp" \
--project="$PROJECT" > output.csv

gcloud compute snapshots list \ --filter="sourceSnapshotSchedulePolicy ~ $POLICY AND sourceDisk~$disk$" \ --format="csv[separator=','](sourceDisk.basename(),name,creationTimestamp,sourceSnapshotSchedulePolicy.basename())" \ --sort-by "~creationTimestamp" \ --project="$PROJECT" > output.csv

Filed Under: Cloud Tagged With: csv, format, gcloud, gcp, output, table

GCP Extend ext4 Boot Volume

July 28, 2022

Here’s how to extend an ext4 boot volume.

gcloud compute disks resize DISK_NAME --size DISK_SIZE --zone ZONE --project PROJECTID

gcloud compute disks resize DISK_NAME --size DISK_SIZE --zone ZONE --project PROJECTID

Resize the file system. Example / is on sda3.

growpart /dev/sda 3
resize2fs /dev/sda3

growpart /dev/sda 3 resize2fs /dev/sda3

Filed Under: Cloud, Linux Tagged With: boot, ext4, extend, gcloud, gcp, growpart, resize2fs, volume

GCP Project Quotas

March 8, 2022

Here’s how to get your project quotas in GCP.

gcloud compute project-info describe --project your-project-id

gcloud compute project-info describe --project your-project-id

Filed Under: Cloud Tagged With: gcloud, gcp, project, quotas

  • Go to page 1
  • Go to page 2
  • Go to page 3
  • Interim pages omitted …
  • Go to page 9
  • Go to Next Page »
  • Home
  • About
  • Search

Copyright © 2023