# Migration from agent\_pool\_profile to default\_node\_pool

**URL:** <https://discuss.hashicorp.com/t/migration-from-agent-pool-profile-to-default-node-pool/11393>\
**Category:** Terraform\
**Tags:** azure\
**Created:** [July 13, 2020, 2:59pm UTC](https://discuss.hashicorp.com/t/migration-from-agent-pool-profile-to-default-node-pool/11393 "2020-07-13T14:59:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![oktapodia](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/oktapodia/32/5378_2.png) [@oktapodia](https://discuss.hashicorp.com/u/oktapodia)\
**Post date:** [July 13, 2020, 2:59pm UTC](https://discuss.hashicorp.com/t/migration-from-agent-pool-profile-to-default-node-pool/11393/1 "2020-07-13T14:59:06Z")

</div>

Hello,

I am currently upgrading my terraform stack with azurerm from the version 1.x to the version 2.x.

I make all the changes from the terraform files, but when trying to apply the configuration, I am getting the following error:

Error: flattening `default_node_pool`: The Default Agent Pool “” was not found

After some investigation in a new deployed stack and the old one, I can see that the block `agent_pool_profile` is existing in the old terraform state file, but has been replaced by `default_node_pool` in the new terraform state file.

Which is also mentioned here [https://www.terraform.io/docs/providers/azurerm/guides/2.0-upgrade-guide.html#removal-of-deprecated-fields-data-sources-and-resources](https://www.terraform.io/docs/providers/azurerm/guides/2.0-upgrade-guide.html#removal-of-deprecated-fields-data-sources-and-resources)

How can I upgrade my stack using k8s with that kind of changes? (I just hope I should not update the tfstate file manually 😅)

Thank you!

---

<div class="post-metadata">

**Author:** ![davidchua](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/davidchua/32/2164_2.png) [@davidchua](https://discuss.hashicorp.com/u/davidchua)\
**Post date:** [July 23, 2020, 3:17am UTC](https://discuss.hashicorp.com/t/migration-from-agent-pool-profile-to-default-node-pool/11393/2 "2020-07-23T03:17:02Z")

</div>

Having the same issue trying to migrate from 1.x to 2.x. I’ve modified the block to `default_node_pool` but appears that its still attempting to check for a `Defautl Agent Pool ""` even though there’s a `name` within the `default_node_pool` block.

Any advice on migrating?

---

<div class="post-metadata">

**Author:** ![brudnyhenry](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/brudnyhenry/32/10238_2.png) [@brudnyhenry](https://discuss.hashicorp.com/u/brudnyhenry)\
**Post date:** [August 6, 2020, 6:34am UTC](https://discuss.hashicorp.com/t/migration-from-agent-pool-profile-to-default-node-pool/11393/3 "2020-08-06T06:34:05Z")

</div>

Hi,  
I had identical issue. The problem was that my AKS cluster default nodepool had mode USER instead of SYSTEM. Old output from az aks nodepool list

```
Name OsType VmSize Count MaxPods ProvisioningState Mode

------- -------- --------------- ------- --------- ------------------- ------

default Linux Standard_DS4_v2 0 110 Succeeded User

```

So the fix was to change the mode to SYSTEM

`az aks nodepool update -g GROUP--cluster-name CLUSTER_NAME -n default --mode system`

and then everything worked

---

<div class="post-metadata">

**Author:** ![vnigam1985](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/vnigam1985/32/16922_2.png) [@vnigam1985](https://discuss.hashicorp.com/u/vnigam1985)\
**Post date:** [February 2, 2021, 4:36pm UTC](https://discuss.hashicorp.com/t/migration-from-agent-pool-profile-to-default-node-pool/11393/4 "2021-02-02T16:36:25Z")

</div>

Thanks Bud, This solved the issue.

---

<div class="post-metadata">

**Author:** ![ashfondu](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/ashfondu/32/17214_2.png) [@ashfondu](https://discuss.hashicorp.com/u/ashfondu)\
**Post date:** [February 12, 2021, 7:44pm UTC](https://discuss.hashicorp.com/t/migration-from-agent-pool-profile-to-default-node-pool/11393/5 "2021-02-12T19:44:37Z")

</div>

I was really hoping that this would resolve my issue but i get new error when running the az aks nodepool update command

“BadRequestError: Operation failed with status: ‘Bad Request’. Details: AgentPool APIs supported only for clusters with VMSS agentpools. For more information, please check [https://aka.ms/multiagentpoollimitations](https://aka.ms/multiagentpoollimitations)”

---

<div class="post-metadata">

**Author:** ![ashfondu](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/ashfondu/32/17214_2.png) [@ashfondu](https://discuss.hashicorp.com/u/ashfondu)\
**Post date:** [February 12, 2021, 9:14pm UTC](https://discuss.hashicorp.com/t/migration-from-agent-pool-profile-to-default-node-pool/11393/6 "2021-02-12T21:14:39Z")

</div>

might be useful for folks who are wondering , how to check if your cluster is User/SYSTEM

az aks nodepool show --cluster-name name -g resource-group --name default --output table
