无法通过Order API在东京等数据中心创建VM 请求协助排查
Let’s walk through the common reasons you might be seeing this error for TOK02 (Tokyo) plus US/UK datacenters, and how to debug each one:
Case sensitivity tripping you up
The error calls outtok02(lowercase) but your datacenter code isTOK02(uppercase). A lot of APIs are strict about case matching—double-check that your code is passing the exact uppercase code. For example, if you have something like:const datacenter = "tok02"; // Oops, wrong caseSwap it to:
const datacenter = "TOK02"; // Correct caseYour account isn’t whitelisted for those regions
Some cloud platforms require explicit whitelisting of datacenters for your API key or account. Head to your provider’s admin dashboard and confirm thatTOK02, US, and UK regions are enabled for your account. If not, you’ll need to request access through your account team.You’re using an outdated API version/endpoint
Older API versions might not recognize newer datacenter codes. Check your org’s internal API docs to make sure you’re using the latest endpoint that supports TOK02, US, and UK regions. For example, if you’re hittinghttps://api.old-domain.com/order, it might need to be updated tohttps://api.new-domain.com/v2/order.Wrong datacenter code mapping
Sometimes the code shown in the console doesn’t match what the API expects. Double-check the official API reference for valid datacenter codes—maybe Tokyo is actuallyTYO01instead ofTOK02, or the US regions useVA01/OR01instead of generic "US" codes.Permissions issue masquerading as "not found"
In some cases, if your API key doesn’t have permissions to create VMs in those regions, the API might return a misleading "datacenter not found" error instead of a clear permission denied message. Verify that your credentials have region-specific create permissions (likevm:create:tokyoorglobal:vm:provision).
Quick next steps to narrow it down
- If you can share the relevant code snippet (the part where you pass the datacenter parameter), that’ll help pinpoint the exact issue.
- Test with a simple curl request to rule out code-specific bugs:
curl -X POST \ https://your-order-api-endpoint.com/vms \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "datacenter": "TOK02", "vm_size": "small", "os": "ubuntu-20.04" }'
内容的提问来源于stack exchange,提问作者user8937789

