Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_kubernetes_cluster not working with Gen2 vm_size #7947

Closed
shebang89 opened this issue Jul 29, 2020 · 2 comments
Closed

azurerm_kubernetes_cluster not working with Gen2 vm_size #7947

shebang89 opened this issue Jul 29, 2020 · 2 comments

Comments

@shebang89
Copy link

shebang89 commented Jul 29, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

Terraform v0.13.0-beta3

  • provider registry.terraform.io/hashicorp/azurerm v2.20.0

Affected Resource(s)

  • azurerm_kubernetes_cluster
  • azurerm_kubernetes_cluster_node_pool

Terraform Configuration Files

provider "azurerm" {
  version = "=2.20.0"
  features {}
}

resource "azurerm_resource_group" "rg" {
  name     = "aks-rg-01"
  location = "West Europe"
}

resource "azurerm_kubernetes_cluster" "aks" {
  name                    = "aks-test"
  location                = azurerm_resource_group.rg.location
  resource_group_name     = azurerm_resource_group.rg.name
  dns_prefix              = "myaks"
  kubernetes_version      = "1.18.4"
  private_cluster_enabled = false

  default_node_pool {
    name       = "default"
    vm_size    = "Standard_DC2s_v2"
    node_count = 1
  }

  identity {
    type = "SystemAssigned"
  }
}

Expected Behavior

Apply complete! Resources: 2 added, 0 changed, 0 destroyed.

Actual Behavior

Error: waiting for creation of Managed Kubernetes Cluster "aks-test" (Resource Group "aks-rg-01"): Code="CreateVMSSAgentPoolFailed" Message="VMSSAgentPoolReconciler retry failed: deployment operations failed with error messages: {\n "code": "BadRequest",\n "message": "The selected VM Size 'Standard_DC2s_v2' cannot boot Hypervisor Generation '1'. If this was a Create operation please check that the Hypervisor Generation of the Image matches the Hypervisor Generation of the selected VM Size. If this was an Update operation please select a Hypervisor Generation '1' VM Size."\n } "

on main.tf line 11, in resource "azurerm_kubernetes_cluster" "aks":
11: resource "azurerm_kubernetes_cluster" "aks" {

Steps to Reproduce

  1. terraform apply

Additional information

Since Terraform didn't work out I had to fall back to az cli, which gave me the exact same error as Terraform did.
After some research in Azure documentation, I figured out I need to install the aks-preview extension in az cli to be able to provision AKS clusters with Gen2 VM sizes.

Here are the steps for a successful deployment with az cli:

az extension add --name aks-preview
az feature register --name Gen2VMPreview --namespace Microsoft.ContainerService
az feature list -o table --query "[?contains(name, 'Microsoft.ContainerService/Gen2VMPreview')].{Name:name,State:properties.state}" (wait until status is "Registered" before proceeding to next step)
az provider register --namespace Microsoft.ContainerService
az group create --name aks-test-rg --location westeurope && \
az aks create \
--name aks-test \
--resource-group aks-test-rg \
--kubernetes-version 1.18.4 \
--node-count 3 \
--node-vm-size Standard_DC2s_v2 \
--aks-custom-headers usegen2vm=true
@tombuildsstuff
Copy link
Contributor

hi @shebang89

Thanks for opening this issue :)

Taking a look through this appears to be a duplicate of #6793 - rather than having multiple issues open tracking the same thing I'm going to close this issue in favour of that one; would you mind subscribing to #6793 for updates?

Thanks!

@ghost
Copy link

ghost commented Sep 23, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Sep 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants