{
  "namespace": "observability",
  "region": "prod-aws-us-west-2",
  "retentionWindow": {
    "end": "2026-08-13T00:00:00Z",
    "start": "2026-05-27T00:00:00Z"
  },
  "shardStepInterval": "6h",
  "sourceReplicaCount": 17,
  "steps": {
    "prepare": {
      "items": [
        {
          "name": "preflight",
          "desc": "Describe the VMCluster; manually confirm Ready status, frozen vmagent split rules, and target cluster readiness",
          "command": [
            "kubectl -n observability describe vmcluster vmcluster"
          ]
        },
        {
          "name": "generate-tenants",
          "desc": "Generate the tenant lists, flatten them with `vm-migration tenants merge`, then pass the flat list to `plan compile` via --tenants (example commands — adjust flags per environment)",
          "command": [
            "# Example commands — adjust flags per environment (see vm-migration tenants --help).",
            "vm-migration tenants dedicated k8s --output tenants-dedicated-k8s.json",
            "vm-migration tenants dedicated s3 --s3-bucket <bucket> --output tenants-dedicated-s3.json",
            "vm-migration tenants essential mgmt --addr <addr> --region <region> --provider <provider> --output essential-mgmt.json",
            "vm-migration tenants essential rds --clusters-in essential-mgmt.json --secret-file <secret-file> --db-host <db-host> --output essential-rds.json",
            "vm-migration tenants essential s3 --clusters-in essential-rds.json --s3-bucket <bucket> --output tenants-essential.json",
            "vm-migration tenants merge --input tenants-dedicated-k8s.json --input tenants-dedicated-s3.json --input tenants-essential.json --output tenants.json"
          ]
        },
        {
          "name": "enable-dedup",
          "desc": "Patch VMCluster vmselect.extraArgs dedup.minScrapeInterval=1ms; idempotent",
          "command": [
            "yq -i 'with(select(.kind == \"VMCluster\"); .spec.vmselect.extraArgs.\"dedup.minScrapeInterval\" = \"1ms\")' <repo-path>/deployments/dataplane/vmcluster/envs/<region>/vmcluster.yaml",
            "git -C <repo-path> diff -- deployments/dataplane/vmcluster/envs/prod-aws-us-west-2/vmcluster.yaml",
            "# Review the diff above; commit and push when ready (not done by this tool). Wait for ArgoCD sync before proceeding to the next stage."
          ]
        },
        {
          "name": "drain-insert",
          "desc": "Patch maintenanceInsertNodeIDs=[8..16]; new writes hash only to vmstorage-0..7",
          "command": [
            "yq -i 'with(select(.kind == \"VMCluster\"); .spec.vmstorage.maintenanceInsertNodeIDs = [8, 9, 10, 11, 12, 13, 14, 15, 16])' <repo-path>/deployments/dataplane/vmcluster/envs/<region>/vmcluster.yaml",
            "git -C <repo-path> diff -- deployments/dataplane/vmcluster/envs/prod-aws-us-west-2/vmcluster.yaml",
            "# Review the diff above; commit and push when ready (not done by this tool). Wait for ArgoCD sync before proceeding to the next stage."
          ]
        },
        {
          "name": "deploy-vmselects",
          "desc": "Deploy both temporary vmselects via the serve API: vmselect-migration on 8..16 (vmctl export source) and vmselect-candidate on 0..7 (verification query path)",
          "command": [
            "# The migration must exist on serve first: curl -X POST <serve>/migrations/<name> --data-binary @<compiled-plan.json>",
            "curl -X POST <serve>/migrations/<name>/deploy",
            "curl -N <serve>/migrations/<name>/logs"
          ]
        }
      ]
    },
    "migration": {
      "items": [
        {
          "name": "run",
          "desc": "Dispatch the migrate-run job (the per-tenant loop sequence is fixed in the tool; see the runbook overview); re-POST resumes incomplete tenants",
          "command": [
            "# Runbook Phase 2 first: probe and estimate, tune only from probe evidence.",
            "curl -X POST <serve>/migrations/<name>/run",
            "curl -N <serve>/migrations/<name>/logs",
            "# Completion gate: poll until done == total and failed == 0.",
            "curl '<serve>/migrations/<name>/summary?format=text'"
          ]
        }
      ]
    },
    "decommission": {
      "items": [
        {
          "name": "drain-select",
          "desc": "Patch maintenanceSelectNodeIDs=[8..16]; production queries no longer touch vmstorage-8..16",
          "command": [
            "yq -i 'with(select(.kind == \"VMCluster\"); .spec.vmstorage.maintenanceSelectNodeIDs = [8, 9, 10, 11, 12, 13, 14, 15, 16])' <repo-path>/deployments/dataplane/vmcluster/envs/<region>/vmcluster.yaml",
            "git -C <repo-path> diff -- deployments/dataplane/vmcluster/envs/prod-aws-us-west-2/vmcluster.yaml",
            "# Review the diff above; commit and push when ready (not done by this tool). Wait for ArgoCD sync before proceeding to the next stage."
          ]
        },
        {
          "name": "scale-down",
          "desc": "Patch vmstorage.replicaCount=8; StatefulSet removes pods 8..16 in reverse order while PVCs are retained",
          "command": [
            "yq -i 'with(select(.kind == \"VMCluster\"); .spec.vmstorage.replicaCount = 8)' <repo-path>/deployments/dataplane/vmcluster/envs/<region>/vmcluster.yaml",
            "git -C <repo-path> diff -- deployments/dataplane/vmcluster/envs/prod-aws-us-west-2/vmcluster.yaml",
            "# Review the diff above; commit and push when ready (not done by this tool). Wait for ArgoCD sync before proceeding to the next stage."
          ]
        },
        {
          "name": "cleanup",
          "desc": "Undeploy vmselect-migration and vmselect-candidate after the rollback window closes",
          "command": [
            "curl -X POST <serve>/migrations/<name>/undeploy",
            "curl -N <serve>/migrations/<name>/logs"
          ]
        }
      ]
    }
  },
  "targetReplicaCount": 8,
  "tenants": [
    "0:0",
    "10104:0",
    "10998:0",
    "11014:0",
    "13576:0",
    "13577:0",
    "14138:0",
    "1495:0",
    "14988:0",
    "14989:0",
    "15129:0",
    "15130:0",
    "162:123184",
    "162:123591",
    "162:123611",
    "162:123733",
    "162:124820",
    "162:125532",
    "162:126719",
    "162:126943",
    "162:127748",
    "162:128142",
    "162:132135",
    "162:133332",
    "162:133499",
    "162:135035",
    "162:135800",
    "162:135873",
    "162:135893",
    "162:136255",
    "162:136457",
    "162:136470",
    "162:137704",
    "162:137705",
    "162:138244",
    "162:138253",
    "162:139377",
    "162:139463",
    "162:139466",
    "162:139478",
    "162:139479",
    "162:139566",
    "162:139631",
    "162:139645",
    "162:139685",
    "162:139707",
    "162:139826",
    "162:139856",
    "162:139882",
    "162:139887",
    "162:139913",
    "162:139924",
    "162:139933",
    "162:139960",
    "162:139989",
    "162:139999",
    "162:140017",
    "162:140022",
    "162:140030",
    "162:140045",
    "162:140048",
    "162:140052",
    "162:140053",
    "162:140059",
    "162:140112",
    "162:140122",
    "162:140123",
    "162:140132",
    "162:140137",
    "162:140141",
    "162:140171",
    "162:140285",
    "16343:0",
    "16360:0",
    "16766:0",
    "18373:0",
    "1959:0",
    "1960:0",
    "1961:0",
    "1962:0",
    "1963:0",
    "1964:0",
    "1965:0",
    "1966:0",
    "1967:0",
    "1968:0",
    "1969:0",
    "1970:0",
    "1971:0",
    "1972:0",
    "1973:0",
    "1974:0",
    "2021:0",
    "2077:0",
    "2080:0",
    "2093:0",
    "23435:0",
    "23632:0",
    "23633:0",
    "25041:0",
    "25094:0",
    "25106:0",
    "25436:0",
    "25443:0",
    "25445:0",
    "27462:0",
    "30222:0",
    "326:0",
    "33766:0",
    "34182:0",
    "34183:0",
    "34587:0",
    "34588:0",
    "34977:0",
    "35338:0",
    "35339:0",
    "35943:0",
    "36214:0",
    "36666:0",
    "36669:0",
    "36964:0",
    "37050:0",
    "37652:0",
    "37707:0",
    "37797:0",
    "37933:0",
    "37971:0",
    "38148:0",
    "38292:0",
    "38298:0",
    "38313:0",
    "38924:0",
    "39260:0",
    "39566:0",
    "39798:0",
    "39831:0",
    "40102:0",
    "40438:0",
    "40509:0",
    "40575:0",
    "40632:0",
    "41017:0",
    "41405:0",
    "42178:0",
    "42877:0",
    "42912:0",
    "42982:0",
    "42983:0",
    "42984:0",
    "42985:0",
    "42986:0",
    "42987:0",
    "42988:0",
    "44254:1",
    "44254:54707",
    "44254:55836",
    "44254:59091",
    "44254:63003",
    "44403:0",
    "44466:0",
    "44494:0",
    "44502:0",
    "44503:0",
    "44533:0",
    "44545:0",
    "44548:0",
    "44612:0",
    "44679:0",
    "44680:0",
    "44681:0",
    "44682:0",
    "44683:0",
    "44684:0",
    "44685:0",
    "44686:0",
    "44687:0",
    "44688:0",
    "44689:0",
    "44690:0",
    "44691:0",
    "44692:0",
    "44693:0",
    "44694:0",
    "44695:0",
    "44696:0",
    "44697:0",
    "44698:0",
    "44699:0",
    "44701:0",
    "44702:0",
    "44703:0",
    "44704:0",
    "44705:0",
    "44706:0",
    "44707:0",
    "44708:0",
    "44709:0",
    "44710:0",
    "44711:0",
    "44712:0",
    "44713:0",
    "44714:0",
    "44715:0",
    "44716:0",
    "44717:0",
    "44718:0",
    "44719:0",
    "44720:0",
    "44721:0",
    "44722:0",
    "44723:0",
    "44724:0",
    "44725:0",
    "44726:0",
    "44727:0",
    "44728:0",
    "44729:0",
    "44730:0",
    "44731:0",
    "44732:0",
    "44733:0",
    "44734:0",
    "44735:0",
    "44736:0",
    "44737:0",
    "44738:0",
    "44739:0",
    "44740:0",
    "44741:0",
    "44742:0",
    "44743:0",
    "44744:0",
    "44745:0",
    "44746:0",
    "44747:0",
    "44748:0",
    "44749:0",
    "44750:0",
    "44751:0",
    "44752:0",
    "44753:0",
    "44754:0",
    "44755:0",
    "44756:0",
    "44757:0",
    "44758:0",
    "44759:0",
    "44760:0",
    "44761:0",
    "44762:0",
    "44763:0",
    "44764:0",
    "44765:0",
    "44766:0",
    "44767:0",
    "44768:0",
    "44769:0",
    "44770:0",
    "44771:0",
    "44772:0",
    "44773:0",
    "44774:0",
    "44775:0",
    "44776:0",
    "44777:0",
    "44778:0",
    "44779:0",
    "44780:0",
    "44781:0",
    "44782:0",
    "44783:0",
    "44784:0",
    "44785:0",
    "44786:0",
    "44787:0",
    "44788:0",
    "44789:0",
    "44790:0",
    "44791:0",
    "44792:0",
    "44793:0",
    "44794:0",
    "44795:0",
    "44796:0",
    "44797:0",
    "44798:0",
    "44799:0",
    "44800:0",
    "44801:0",
    "44802:0",
    "44803:0",
    "44804:0",
    "44822:0",
    "44823:0",
    "44824:0",
    "44825:0",
    "44826:0",
    "44827:0",
    "44828:0",
    "44829:0",
    "44830:0",
    "44831:0",
    "44842:0",
    "44843:0",
    "44844:0",
    "44845:0",
    "44846:0",
    "44847:0",
    "44848:0",
    "44849:0",
    "44850:0",
    "44851:0",
    "44852:0",
    "44853:0",
    "44854:0",
    "44855:0",
    "44856:0",
    "44857:0",
    "44858:0",
    "44859:0",
    "44860:0",
    "44861:0",
    "44862:0",
    "44863:0",
    "44864:0",
    "44865:0",
    "44866:0",
    "44867:0",
    "44868:0",
    "44869:0",
    "44870:0",
    "44871:0",
    "44872:0",
    "44873:0",
    "44874:0",
    "44875:0",
    "44876:0",
    "44877:0",
    "44878:0",
    "44879:0",
    "44880:0",
    "44881:0",
    "44882:0",
    "44883:0",
    "44884:0",
    "44885:0",
    "44886:0",
    "44887:0",
    "44888:0",
    "44889:0",
    "44890:0",
    "44891:0",
    "44892:0",
    "44893:0",
    "44894:0",
    "44895:0",
    "44896:0",
    "44897:0",
    "44898:0",
    "44899:0",
    "44900:0",
    "44901:0",
    "44902:0",
    "44903:0",
    "44904:0",
    "44905:0",
    "44906:0",
    "44907:1",
    "44907:10",
    "44907:12",
    "44907:15",
    "44907:19",
    "44907:24",
    "44907:27",
    "44907:3",
    "44907:30",
    "44907:302",
    "44907:303",
    "44907:32",
    "44907:34",
    "44907:36",
    "44907:39",
    "44907:48",
    "44907:5",
    "44907:51",
    "44907:52",
    "44907:54",
    "44907:58",
    "44909:0",
    "44910:0",
    "44911:0",
    "44912:0",
    "44913:0",
    "44914:0",
    "44915:0",
    "44916:0",
    "44917:0",
    "44918:0",
    "44919:0",
    "44932:0",
    "44933:0",
    "44934:0",
    "44935:0",
    "44936:0",
    "44937:0",
    "44938:0",
    "44939:0",
    "44940:0",
    "44941:0",
    "44942:0",
    "44943:0",
    "44944:0",
    "44945:0",
    "44946:0",
    "44947:0",
    "44948:0",
    "44949:0",
    "44950:0",
    "44951:0",
    "44952:0",
    "44953:0",
    "44954:0",
    "44955:0",
    "44956:0",
    "44957:0",
    "44958:0",
    "44959:0",
    "44960:0",
    "44961:0",
    "44962:0",
    "44963:0",
    "44964:0",
    "44965:0",
    "44966:0",
    "44967:0",
    "44968:0",
    "44969:0",
    "44970:0",
    "44971:0",
    "44972:0",
    "44992:0",
    "44993:0",
    "44994:0",
    "44995:0",
    "44996:0",
    "45002:0",
    "45003:0",
    "45004:0",
    "45005:0",
    "45006:0",
    "45007:0",
    "45008:0",
    "45009:0",
    "45010:0",
    "45011:0",
    "45032:0",
    "45033:0",
    "45034:0",
    "45035:0",
    "45036:0",
    "45037:0",
    "45038:0",
    "45039:0",
    "45040:0",
    "45041:0",
    "45042:0",
    "45043:0",
    "45044:0",
    "45045:0",
    "45046:0",
    "45062:0",
    "45063:0",
    "45064:0",
    "45065:0",
    "45066:0",
    "45067:0",
    "45068:0",
    "45069:0",
    "45070:0",
    "45071:0",
    "45082:0",
    "45083:0",
    "45084:0",
    "45085:0",
    "45086:0",
    "45087:0",
    "45088:0",
    "45102:0",
    "45103:0",
    "45104:0",
    "45105:0",
    "45106:0",
    "45107:0",
    "45108:0",
    "45109:0",
    "45110:0",
    "45111:0",
    "45122:0",
    "45123:0",
    "45124:0",
    "45125:0",
    "45126:0",
    "45127:0",
    "45128:0",
    "45129:0",
    "45130:0",
    "45131:0",
    "45132:0",
    "45133:0",
    "45134:0",
    "45135:0",
    "45136:0",
    "45137:0",
    "45138:0",
    "45139:0",
    "45140:0",
    "45141:0",
    "45142:0",
    "45143:0",
    "45144:0",
    "45145:0",
    "45146:0",
    "45192:0",
    "45222:0",
    "45252:0",
    "45253:0",
    "45254:0",
    "45282:0",
    "45283:0",
    "45284:0",
    "45285:0",
    "45286:0",
    "45287:0",
    "45288:0",
    "45289:0",
    "45290:0",
    "45291:0",
    "45302:0",
    "45303:0",
    "45304:0",
    "45305:0",
    "45306:0",
    "45307:0",
    "45308:0",
    "45309:0",
    "45310:0",
    "45311:0",
    "45312:0",
    "45313:0",
    "45314:0",
    "45315:0",
    "45316:0",
    "45317:0",
    "45318:0",
    "45319:0",
    "45320:0",
    "45321:0",
    "45322:0",
    "45323:0",
    "45324:0",
    "45325:0",
    "45326:0",
    "45327:0",
    "45328:0",
    "45342:0",
    "45343:0",
    "45344:0",
    "45345:0",
    "45346:0",
    "45392:0",
    "45393:0",
    "45394:0",
    "45395:0",
    "45396:0",
    "45397:0",
    "45398:0",
    "45399:0",
    "45400:0",
    "45401:0",
    "45402:0",
    "45403:0",
    "45404:0",
    "45405:0",
    "45406:0",
    "45407:0",
    "45408:0",
    "45409:0",
    "45410:0",
    "45411:0",
    "45412:0",
    "45413:0",
    "45422:0",
    "45423:0",
    "45424:0",
    "45425:0",
    "45426:0",
    "45427:0",
    "45428:0",
    "45429:0",
    "45430:0",
    "45431:0",
    "45432:0",
    "45433:0",
    "45434:0",
    "45435:0",
    "45436:0",
    "45437:0",
    "45438:0",
    "45439:0",
    "45440:0",
    "45441:0",
    "45442:0",
    "45443:0",
    "45444:0",
    "45445:0",
    "45446:0",
    "45447:0",
    "45448:0",
    "45449:0",
    "45450:0",
    "45451:0",
    "45452:0",
    "45453:0",
    "45454:0",
    "45455:0",
    "45456:0",
    "45457:0",
    "45458:0",
    "45459:0",
    "45460:0",
    "45461:0",
    "45462:0",
    "45482:0",
    "45483:0",
    "45484:0",
    "45485:0",
    "45486:0",
    "45487:0",
    "45488:0",
    "45489:0",
    "45490:0",
    "45491:0",
    "45502:0",
    "45503:0",
    "45504:0",
    "45505:0",
    "45506:0",
    "45507:0",
    "45508:0",
    "45509:0",
    "45510:0",
    "45511:0",
    "45512:0",
    "45513:0",
    "45514:0",
    "45515:0",
    "45516:0",
    "45517:0",
    "45518:0",
    "45519:0",
    "45520:0",
    "45521:0",
    "45522:0",
    "45523:0",
    "45524:0",
    "45525:0",
    "5009:0",
    "5420:0",
    "5422:0",
    "5426:0",
    "5676:0",
    "5740:0",
    "5806:0",
    "62:0",
    "64:0",
    "65:0",
    "6606:0",
    "6609:0",
    "6635:0",
    "7990:0",
    "81:0",
    "90:0",
    "91:0",
    "93:0",
    "9718:0"
  ],
  "vmcluster": {
    "name": "vmcluster",
    "vminsertName": "vminsert-vmcluster",
    "vminsertURLPattern": "http://vminsert-vmcluster.observability.svc.cluster.local:8480/insert/{tenant}/prometheus",
    "vmselectName": "vmselect-vmcluster",
    "vmselectURLPattern": "http://vmselect-vmcluster.observability.svc.cluster.local:8481/select/{tenant}/prometheus"
  },
  "vmctl": {
    "concurrency": 4,
    "rateLimitBytes": null,
    "stepInterval": "day"
  },
  "vmselects": {
    "image": "557537366020.dkr.ecr.us-west-2.amazonaws.com/victoriametrics/vmselect:v1.122.2-cluster",
    "migration": {
      "name": "vmselect-migration",
      "urlPattern": "http://vmselect-migration.observability.svc.cluster.local:8481/select/{tenant}/prometheus",
      "replicas": 2,
      "resources": {
        "limits": {
          "cpu": "1",
          "memory": "4Gi"
        },
        "requests": {
          "cpu": "0.5",
          "memory": "2Gi"
        }
      }
    },
    "candidate": {
      "name": "vmselect-candidate",
      "urlPattern": "http://vmselect-candidate.observability.svc.cluster.local:8481/select/{tenant}/prometheus",
      "replicas": 1,
      "resources": {
        "limits": {
          "cpu": "1",
          "memory": "4Gi"
        },
        "requests": {
          "cpu": "0.5",
          "memory": "2Gi"
        }
      }
    }
  }
}
