No allocation in region

I have an app named e0d10f6d-42e8-4b30-816c-c47044697eed whose regions are set to Chicago (ord) and London (lhr). However, only 1 allocation is shown in the dashboard, VPN, and DNS (.internal).

Given that this is a test app, almost no traffic has hit it. Will an allocation only be created in that region if traffic increases? Or what am I missing?

Hi @yroc,

Have you configured autoscaling/scaling?

I’m using the launchApp graphql mutation and providing the following fields only:

organizationId
name
config
vmSize
regions
secrets
image

@yroc try the following, where count equals the number of regions set.

fly scale count 2 --max-per-region=1

1 Like

So I’m using the graphql api, namely the following methods in this order:

  1. createApp
  2. setSecrets
  3. deployImage
  4. scaleApp

How would I do what you’ve said @dusty via API? In addition, it appears to not even use the region I send to the API and only launches in the preferredRegion which I don’t include in any of the 4 methods above.

Here is an app that I’m testing with for context:

{
  "data": {
    "app": {
      "id": "f2eebb10-cc5e-48b2-bc5a-38b79c27a8b8",
      "autoscaling": {
        "enabled": false,
        "balanceRegions": false,
        "maxCount": 10,
        "minCount": 0,
        "preferredRegion": "lax",
        "regions": [
          {
            "code": "lax",
            "minCount": 0,
            "weight": 100
          },
          {
            "code": "dfw",
            "minCount": 1,
            "weight": 100
          },
          {
            "code": "ord",
            "minCount": 1,
            "weight": 100
          }
        ],
        "strategy": "NONE"
      },
...

I think you’ll need to use setVmCount

mutation scaleCount{
  setVmCount(input: {
    appId: "f2eebb10-cc5e-48b2-bc5a-38b79c27a8b8",
    groupCounts: [{group: "app", count: 2}]
  }){

Let me know if that helps.

It did, kind of.

I am now seeing proper config with the app details as seen below. However, the dashboard shows that I’m currently running a VM in the preferred region, lax. How do I stop that from happening?

My operations are now like so:

  1. createApp
  2. setSecrets
  3. deployImage
  4. scaleApp
  5. setVmCount

{
  "data": {
    "app": {
      "id": "947fafc1-fa97-4998-b86d-5590d18b4deb",
      "autoscaling": {
        "enabled": false,
        "balanceRegions": false,
        "maxCount": 10,
        "minCount": 0,
        "preferredRegion": "lax",
        "regions": [
          {
            "code": "lax",
            "minCount": 0,
            "weight": 100
          },
          {
            "code": "ord",
            "minCount": 1,
            "weight": 100
          },
          {
            "code": "iad",
            "minCount": 1,
            "weight": 100
          }
        ],
        "strategy": "NONE"
...

Try manipulating configureRegions. Ie, if you want to stop the lax instance:

mutation {
  configureRegions(input: {
    appId: "947fafc1-fa97-4998-b86d-5590d18b4deb",
    allowRegions: [
      "iad"
    ]
    denyRegions: [
      "lax"
    ]
  }){
    regions{
      code
    }
  }
}

I think the start to finish would look like:

  1. createApp
  2. setSecrets
  3. deployImage
  4. configureRegions
  • with only allowRegions: [ "iad" ] , deny shouldn’t be needed.
  1. setVmCount

The trick was I need to include the preferredRegion with createApp. It defaults to your account’s preferred region if you don’t offer a value. Thank you!

Also, can setVmCount be run before I run deployImage?