<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Creating Azure VM from vSZ VHD file. in SmartZone and Virtual SmartZone</title>
    <link>https://community.ruckuswireless.com/t5/SmartZone-and-Virtual-SmartZone/Creating-Azure-VM-from-vSZ-VHD-file/m-p/38087#M3216</link>
    <description>&lt;P alt="" name="" rel="" target="" title="" type="" value=""&gt;I am trying to deploy virtual smart zone to Azure via Terraform, but could not succeed many times.&amp;nbsp;Did you have any experience about this? Please give me an advice. Thank you so much.&lt;/P&gt;&lt;P alt="" name="" rel="" target="" title="" type="" value=""&gt;Here are the details:&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;Terraform Version:&lt;/P&gt;&lt;PRE alt="" name="" rel="" target="" title="" type="" value=""&gt;&lt;CODE alt="" name="" rel="" target="" title="" type="" value=""&gt;tien$ terraform -v&lt;BR alt="" title="" name="" value="" type="" target="" rel="" /&gt;Terraform v0.11.13
+ provider.azurerm v1.27.1
+ provider.random v2.1.2

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P alt="" name="" rel="" target="" title="" type="" value=""&gt;What terraform did I write:&lt;/P&gt;&lt;PRE alt="" name="" rel="" target="" title="" type="" value=""&gt;&lt;CODE alt="" name="" rel="" target="" title="" type="" value=""&gt;resource "azurerm_virtual_machine" "vsz_vm" {
  name                          = "vsz.az.example.com"
  location                      = "${var.location}"
  resource_group_name           = "${azurerm_resource_group.abc.name}"
  network_interface_ids         = ["${azurerm_network_interface.vsz_nic.id}"]
  vm_size                       = "Standard_D4_v3"

  storage_image_reference {
    id                          = "/subscriptions/4389d27e-249a-4f95-8bd6-3486c60945e7/resourceGroups/ABC/providers/Microsoft.Storage/storageAccounts/vszafb3c92c014b61ab/images/vscg-5.1.1.0.598.vhd"
  }

  storage_os_disk {
    name                        = "vszOsDisk"
    managed_disk_type           = "Premium_LRS"
    create_option               = "FromImage"
    os_type                     = "Linux"
  }

  os_profile {
    computer_name               = "vsz.az.example.com"
    admin_username              = "azure"
  }

  os_profile_linux_config {
    disable_password_authentication = true
    ssh_keys {
      path                      = "/home/azure/.ssh/authorized_keys"
      key_data                  = "${var.ssh_public_key}"
    }
  }

  tags {
    environment                 = "${var.environment}"
  }
}

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P alt="" name="" rel="" target="" title="" type="" value=""&gt;then I run terraform command&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;CODE alt="" name="" rel="" target="" title="" type="" value=""&gt;tien$ terraform init --&amp;gt; OK&lt;/CODE&gt;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;CODE alt="" name="" rel="" target="" title="" type="" value=""&gt;tien$ terraform plan --&amp;gt; OK&lt;/CODE&gt;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;CODE alt="" name="" rel="" target="" title="" type="" value=""&gt;tien$ terraform apply --&amp;gt; ERROR&lt;/CODE&gt;&lt;/P&gt;&lt;P alt="" name="" rel="" target="" title="" type="" value=""&gt;What issue?&lt;/P&gt;&lt;PRE alt="" name="" rel="" target="" title="" type="" value=""&gt;&lt;CODE alt="" name="" rel="" target="" title="" type="" value=""&gt;Error: Error applying plan:
1 error(s) occurred:
* module.azure_example_dlc.azurerm_virtual_machine.vsz_vm: 1 error(s) occurred:
* azurerm_virtual_machine.vsz_vm: compute.VirtualMachinesClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="BadRequest" Message="Id /subscriptions/4389d27e-249a-4f95-8bd6-3486c60945e7/resourceGroups/ABC/providers/Microsoft.Storage/storageAccounts/vszafb3c92c014b61ab/images/vscg-5.1.1.0.598.vhd is not a valid resource reference."
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P alt="" name="" rel="" target="" title="" type="" value=""&gt;The VHD file vscg-5.1.1.0.598.vhd exists in container "images" at Storage Account "vszafb3c92c014b61ab".&lt;/P&gt;&lt;P alt="" name="" rel="" target="" title="" type="" value=""&gt;Also I create the Managed Image before creating VM from Managed Image as below code:&lt;/P&gt;&lt;PRE alt="" name="" rel="" target="" title="" type="" value=""&gt;&lt;CODE alt="" name="" rel="" target="" title="" type="" value=""&gt;  storage_image_reference {
    id                          = "/subscriptions/4389d27e-249a-4f95-8bd6-3486c60945e7/resourceGroups/ABC/providers/Microsoft.Storage/storageAccounts/vszafb3c92c014b61ab/images/vscg-5.1.1.0.598.vhd"
  }

  storage_os_disk {
    name                        = "vszOsDisk"
    managed_disk_type           = "Premium_LRS"
    create_option               = "FromImage"&amp;nbsp;
&lt;/CODE&gt;&amp;nbsp; &amp;nbsp; os_type                     = "Linux"
  }&lt;/PRE&gt;</description>
    <pubDate>Thu, 16 May 2019 15:19:21 GMT</pubDate>
    <dc:creator>tien_phan_anotw</dc:creator>
    <dc:date>2019-05-16T15:19:21Z</dc:date>
    <item>
      <title>Creating Azure VM from vSZ VHD file.</title>
      <link>https://community.ruckuswireless.com/t5/SmartZone-and-Virtual-SmartZone/Creating-Azure-VM-from-vSZ-VHD-file/m-p/38087#M3216</link>
      <description>&lt;P alt="" name="" rel="" target="" title="" type="" value=""&gt;I am trying to deploy virtual smart zone to Azure via Terraform, but could not succeed many times.&amp;nbsp;Did you have any experience about this? Please give me an advice. Thank you so much.&lt;/P&gt;&lt;P alt="" name="" rel="" target="" title="" type="" value=""&gt;Here are the details:&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;Terraform Version:&lt;/P&gt;&lt;PRE alt="" name="" rel="" target="" title="" type="" value=""&gt;&lt;CODE alt="" name="" rel="" target="" title="" type="" value=""&gt;tien$ terraform -v&lt;BR alt="" title="" name="" value="" type="" target="" rel="" /&gt;Terraform v0.11.13
+ provider.azurerm v1.27.1
+ provider.random v2.1.2

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P alt="" name="" rel="" target="" title="" type="" value=""&gt;What terraform did I write:&lt;/P&gt;&lt;PRE alt="" name="" rel="" target="" title="" type="" value=""&gt;&lt;CODE alt="" name="" rel="" target="" title="" type="" value=""&gt;resource "azurerm_virtual_machine" "vsz_vm" {
  name                          = "vsz.az.example.com"
  location                      = "${var.location}"
  resource_group_name           = "${azurerm_resource_group.abc.name}"
  network_interface_ids         = ["${azurerm_network_interface.vsz_nic.id}"]
  vm_size                       = "Standard_D4_v3"

  storage_image_reference {
    id                          = "/subscriptions/4389d27e-249a-4f95-8bd6-3486c60945e7/resourceGroups/ABC/providers/Microsoft.Storage/storageAccounts/vszafb3c92c014b61ab/images/vscg-5.1.1.0.598.vhd"
  }

  storage_os_disk {
    name                        = "vszOsDisk"
    managed_disk_type           = "Premium_LRS"
    create_option               = "FromImage"
    os_type                     = "Linux"
  }

  os_profile {
    computer_name               = "vsz.az.example.com"
    admin_username              = "azure"
  }

  os_profile_linux_config {
    disable_password_authentication = true
    ssh_keys {
      path                      = "/home/azure/.ssh/authorized_keys"
      key_data                  = "${var.ssh_public_key}"
    }
  }

  tags {
    environment                 = "${var.environment}"
  }
}

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P alt="" name="" rel="" target="" title="" type="" value=""&gt;then I run terraform command&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;CODE alt="" name="" rel="" target="" title="" type="" value=""&gt;tien$ terraform init --&amp;gt; OK&lt;/CODE&gt;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;CODE alt="" name="" rel="" target="" title="" type="" value=""&gt;tien$ terraform plan --&amp;gt; OK&lt;/CODE&gt;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;CODE alt="" name="" rel="" target="" title="" type="" value=""&gt;tien$ terraform apply --&amp;gt; ERROR&lt;/CODE&gt;&lt;/P&gt;&lt;P alt="" name="" rel="" target="" title="" type="" value=""&gt;What issue?&lt;/P&gt;&lt;PRE alt="" name="" rel="" target="" title="" type="" value=""&gt;&lt;CODE alt="" name="" rel="" target="" title="" type="" value=""&gt;Error: Error applying plan:
1 error(s) occurred:
* module.azure_example_dlc.azurerm_virtual_machine.vsz_vm: 1 error(s) occurred:
* azurerm_virtual_machine.vsz_vm: compute.VirtualMachinesClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="BadRequest" Message="Id /subscriptions/4389d27e-249a-4f95-8bd6-3486c60945e7/resourceGroups/ABC/providers/Microsoft.Storage/storageAccounts/vszafb3c92c014b61ab/images/vscg-5.1.1.0.598.vhd is not a valid resource reference."
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P alt="" name="" rel="" target="" title="" type="" value=""&gt;The VHD file vscg-5.1.1.0.598.vhd exists in container "images" at Storage Account "vszafb3c92c014b61ab".&lt;/P&gt;&lt;P alt="" name="" rel="" target="" title="" type="" value=""&gt;Also I create the Managed Image before creating VM from Managed Image as below code:&lt;/P&gt;&lt;PRE alt="" name="" rel="" target="" title="" type="" value=""&gt;&lt;CODE alt="" name="" rel="" target="" title="" type="" value=""&gt;  storage_image_reference {
    id                          = "/subscriptions/4389d27e-249a-4f95-8bd6-3486c60945e7/resourceGroups/ABC/providers/Microsoft.Storage/storageAccounts/vszafb3c92c014b61ab/images/vscg-5.1.1.0.598.vhd"
  }

  storage_os_disk {
    name                        = "vszOsDisk"
    managed_disk_type           = "Premium_LRS"
    create_option               = "FromImage"&amp;nbsp;
&lt;/CODE&gt;&amp;nbsp; &amp;nbsp; os_type                     = "Linux"
  }&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 May 2019 15:19:21 GMT</pubDate>
      <guid>https://community.ruckuswireless.com/t5/SmartZone-and-Virtual-SmartZone/Creating-Azure-VM-from-vSZ-VHD-file/m-p/38087#M3216</guid>
      <dc:creator>tien_phan_anotw</dc:creator>
      <dc:date>2019-05-16T15:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Azure VM from vSZ VHD file.</title>
      <link>https://community.ruckuswireless.com/t5/SmartZone-and-Virtual-SmartZone/Creating-Azure-VM-from-vSZ-VHD-file/m-p/38088#M3217</link>
      <description>This issue was solved. My bad, I did choose the wrong approach.&amp;nbsp;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;UL alt="" name="" rel="" target="" title="" type="" value=""&gt;&lt;LI alt="" name="" rel="" target="" title="" type="" value=""&gt;used Managed Disk.&amp;nbsp;&lt;/LI&gt;&lt;LI alt="" name="" rel="" target="" title="" type="" value=""&gt;used Block blob&lt;/LI&gt;&lt;/UL&gt;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;B alt="" name="" rel="" target="" title="" type="" value=""&gt;Here are what I did to solve:&lt;/B&gt;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;UL alt="" name="" rel="" target="" title="" type="" value=""&gt;&lt;LI alt="" name="" rel="" target="" title="" type="" value=""&gt;Re-upload the VHD image to Page blob to replace Block blob.&amp;nbsp;&lt;/LI&gt;&lt;LI alt="" name="" rel="" target="" title="" type="" value=""&gt;use Unmanaged Disk. Why? my VHD image stores in Page blob. Then it is backed of Virtual Hard Disk of VM.&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;B alt="" name="" rel="" target="" title="" type="" value=""&gt;Note:&lt;/B&gt;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;I used to Azure Storage Explorer to replace for uploading the VHD file. The VHD 42 GB often meet an issue when uploading via Azure Web Browser.&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;Azure Storage supports three types of blobs:&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;Block blob stores text and binary data, up to about 4.7 TB. Block blob are made up of blocks of data that can be managed individually.&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;Append blob are made of blocks like block blobs, but are optimized for append operation. Append blob are ideal for scenarios such as logging data from virtual machine.&amp;nbsp;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;Page blob store random access files up to 8 TB in size. Page blob store the virtual hard drive (VHD) files serve as disks for Azure virtual machine.&amp;nbsp;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;finally, this is my Terraform code&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;```&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;resource "azurerm_virtual_machine" "vsz_vm" {&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; name&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = "vsz.az.example.com"&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; location&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = "${var.location}"&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; resource_group_name&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= "${azurerm_resource_group.abc.name}"&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; network_interface_ids&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= ["${azurerm_network_interface.vsz_nic.id}"]&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; vm_size&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= "Standard_D4_v3"&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; storage_os_disk {&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; &amp;nbsp; name&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = "vszOsDisk"&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; &amp;nbsp; # source VHD as reference&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; &amp;nbsp; image_uri&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= "&lt;A alt="" href="https://vszafb3.blob.core.windows.net/images/vscg-5.1.1.0.598.vhd%22" name="" rel="nofollow" target="" title="" type="" value=""&gt;https://vszafb3.blob.core.windows.net/images/vscg-5.1.1.0.598.vhd"&lt;/A&gt;;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; &amp;nbsp; # destination VHD to create&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; &amp;nbsp; vhd_uri&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= "&lt;A alt="" href="https://vszafb3.blob.core.windows.net/images/vscg-5.1.1.0.601.vhd%22" name="" rel="nofollow" target="" title="" type="" value=""&gt;https://vszafb3.blob.core.windows.net/images/vscg-5.1.1.0.601.vhd"&lt;/A&gt;;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; &amp;nbsp; os_type&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= "Linux"&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; &amp;nbsp; create_option&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= "FromImage"&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; }&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; os_profile {&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; &amp;nbsp; computer_name&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= "vsz.az.example.com"&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; &amp;nbsp; admin_username&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = "azure"&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; }&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; os_profile_linux_config {&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; &amp;nbsp; disable_password_authentication = true&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; &amp;nbsp; ssh_keys {&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; path&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = "/home/azure/.ssh/authorized_keys"&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; key_data&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = "${var.ssh_public_key}"&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; &amp;nbsp; }&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; }&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;```&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;This issue was closed.&amp;nbsp;</description>
      <pubDate>Mon, 20 May 2019 04:10:15 GMT</pubDate>
      <guid>https://community.ruckuswireless.com/t5/SmartZone-and-Virtual-SmartZone/Creating-Azure-VM-from-vSZ-VHD-file/m-p/38088#M3217</guid>
      <dc:creator>tien_phan_anotw</dc:creator>
      <dc:date>2019-05-20T04:10:15Z</dc:date>
    </item>
  </channel>
</rss>

