What are acceptable values for the `--vm-size` option for "fly postgres create"?

I’m trying to follow the instructions here: Flyctl

They give me this info:

  -h, --help                  help for create
      --name string           the name of the new app
      --organization string   the organization that will own the app
      --password string       the superuser password. one will be generated for you if you leave this blank
      --region string         the region to launch the new app in
      --snapshot-id string    Creates the volume with the contents of the snapshot
      --vm-size string        the size of the VM
      --volume-size string    the size in GB for volumes

I tried passing both “256” and “256mb” as the string for --vm-size, but both got rejected with errors like:

Error vm size "256mb" not found

What are valid values that I can pass? And specifically, what is the valid value for the smallest one, because I want to stay on the free tier if possible.

Thanks.

@crowell.jon You can see the available vm-sizes by running:

$ fly platform vm-sizes

NAME             CPU CORES MEMORY
shared-cpu-1x    1         256 MB
dedicated-cpu-1x 1         2 GB
dedicated-cpu-2x 2         4 GB
dedicated-cpu-4x 4         8 GB
dedicated-cpu-8x 8         16 GB

@shaun I’m so confused. This does not seem to work at all:

❯ fly platform vm-sizes
NAME                    CPU CORES       MEMORY
shared-cpu-1x           1               256 MB
dedicated-cpu-1x        1               2 GB
dedicated-cpu-2x        2               4 GB
dedicated-cpu-4x        4               8 GB
dedicated-cpu-8x        8               16 GB


❯ fly postgres create \
        --name flxwebsites-db \
        --initial-cluster-size 1 \
        --vm-size dedicated-cpu-1x \
        --volume-size 40 \
        --org flx-websites \
        --region ewr

Error vm size "dedicated-cpu-1x" is not valid

@nicksergeant Looks like we still need to add the sizes for Machines, sorry about that!

The available machine sizes can be seen here:

1 Like

:+1::+1:

@shaun it seems that while it no longer errors on the VM here, it doesn’t actually set the VM size correctly:

	@fly postgres create \
		--name flxwebsites-db \
		--initial-cluster-size 2 \
		--vm-size shared-cpu-2x \
		--volume-size 40

Results in:

Is there any way to actually see the allocated memory for Postgres cluster machines?

@nicksergeant Looks like a bug in the UI as your machines look like they were created with the correct resources.

You can confirm this via the cli.

  1. fly status --app flxwebsites-db
  2. fly machine status <machine-id>

@shaun hmm, am I doing something wrong here?

❯ fly status --app flxwebsites-db
ID              STATE   ROLE    REGION  HEALTH CHECKS           IMAGE                           CREATED                 UPDATED
21781329f24689  started replica iad     3 total, 3 passing      flyio/postgres:14.4 (v0.0.32)   2022-11-27T23:00:48Z    2022-11-27T23:01:06Z
7328790ec13085  started leader  iad     3 total, 3 passing      flyio/postgres:14.4 (v0.0.32)   2022-11-27T23:00:28Z    2022-11-27T23:00:45Z

❯ fly machine status 21781329f24689
Error machine 21781329f24689 could not be retrieved

Oh, looks like you need to also specify an app:

❯ fly machine status 21781329f24689 -a flxwebsites-db
Machine ID: 21781329f24689
Instance ID: 01GJXN4QXXSK8BB2WP3TKF6GJT
State: started

VM
  ID            = 21781329f24689
  Instance ID   = 01GJXN4QXXSK8BB2WP3TKF6GJT
  State         = started
  Image         = flyio/postgres:14.4 (v0.0.32)
  Name          = autumn-water-766
  Private IP    = fdaa:0:db85:a7b:92:97f:f1a8:2
  Region        = iad
  Process Group =
  Memory        = 4096
  CPUs          = 2
  Created       = 2022-11-27T23:00:48Z
  Updated       = 2022-11-27T23:01:06Z
  Command       =
  Volume        = vol_g2yxp4mpon3463qd

Event Logs
STATE   EVENT   SOURCE  TIMESTAMP                       INFO
started start   flyd    2022-11-27T18:01:06.338-05:00
created launch  user    2022-11-27T18:00:48.755-05:00
1 Like