-1

If I create a VM based on Ubuntu Server 18.04-LTS it has terraform.

If I create a scale set based on Ubuntu Server 18.04-LTS a spawned VM from it does not.

What am I missing?

garthoid
  • 195
  • 2
  • 11

1 Answers1

0

Generally, if you can create a VM from the image, then you can also create the VMSS from that image. And it does it on my side. Below is the example code for the image and you can get the whole code here:

source_image_reference {
    publisher = "Canonical"
    offer     = "UbuntuServer"
    sku       = "18.04-LTS"
    version   = "latest"
  }

And the screenshot here shows the result that creates the VMSS through the Terraform:

enter image description here

Charles Xu
  • 29,862
  • 2
  • 22
  • 39
  • This was my impression. However the VM I create and the VM generated from a scale set did not have the same components. For example, the VM generated had /usr/bin/terraform. The image from the scale set I was using in an Azure DevOps pipeline did not. – garthoid May 14 '21 at 16:22
  • @garthoid Are you really find the file `/usr/bin/terraform` in the new VM with the image UbuntuServer 18.04-LTS? It's impossible in Azure. But if you mean the DevOps. Then it's true, the VM images in DevOps are not the same as Azure. DevOps create the VM for the tasks. – Charles Xu May 17 '21 at 01:16
  • The scenario is that an Azure DevOps release pipeline creates a vm using an Azure scale set based on a Service Principal. Runing a bash task within I was unable to find the terraform executable, either in /usr/bin or anywhere with the find command. – garthoid May 18 '21 at 02:19
  • @garthoid As I know, if you use the pipeline agent, you should install the Terraform first, both the VM and the VMSS. – Charles Xu May 18 '21 at 02:30
  • Yes, that typically applies to the default azure pipeline agent. But my expectation was that if I had an Azure Virtual Machine Scale Set based on an Azure image that would be the same as a VM I would create based on that same image. In my case it was my own AzDO agent pool based on a machine scale set I had defined in my Azure subscription. – garthoid May 18 '21 at 13:09
  • @garthoid If the same image, the VMSS will have the same things inside it. But as you said the image can't be used by the VMSS. Maybe the DevOps have different limitations as the Azure portal. You can install the Terraform in the VMSS manually. – Charles Xu May 19 '21 at 08:10
  • @garthoid Any updates on the question? Does it solve your problem? – Charles Xu May 28 '21 at 01:47