I am new to Azure. I have this existing VM. It was built by my colleague and I think he built it through the Marketplace with the Azure portal.
Now I want to build a new one with the same settings (that have the same performance spec) such as the VM sku, OS disk, and data disk. I don't want to keep any existing data. It will be built in a different RG with a different VNet and subnet. What is the best way to do it?
I tried to "export template" on the current VM but I think the JSON file just specifies the existing disks and NIC to use, instead of creating new ones. Here is what it looks like
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"virtualMachines_myCurrentVM_name": {
"defaultValue": "myCurrentVM",
"type": "String"
},
"disks_myCurrentVM_OsDisk_1_xxxxxx_externalid": {
"defaultValue": "/subscriptions/12345678-abcd-abcd-abcd-12345678/resourceGroups/nmtprdarmrgp001/providers/Microsoft.Compute/disks/myCurrentVM_OsDisk_1_xxxxxx",
"type": "String"
},
"disks_myCurrentVM_DataDisk_0_externalid": {
"defaultValue": "/subscriptions/12345678-abcd-abcd-abcd-12345678/resourceGroups/nmtprdarmrgp001/providers/Microsoft.Compute/disks/myCurrentVM_DataDisk_0",
"type": "String"
},
"networkInterfaces_myCurrentVM290_externalid": {
"defaultValue": "/subscriptions/12345678-abcd-abcd-abcd-12345678/resourceGroups/nmtprdarmrgp001/providers/Microsoft.Network/networkInterfaces/myCurrentVM290",
"type": "String"
}
},
"variables": {},
"resources": [
{
"type": "Microsoft.Compute/virtualMachines",
"apiVersion": "2021-11-01",
"name": "[parameters('virtualMachines_myCurrentVM_name')]",
"location": "westus2",
"tags": {
"a": "1",
"b": "2"
},
"plan": {
"name": "f5-bigiq-virtual-edition-byol",
"product": "f5-big-iq",
"publisher": "f5-networks"
},
"properties": {
"hardwareProfile": {
"vmSize": "Standard_D4_v3"
},
"storageProfile": {
"imageReference": {
"publisher": "f5-networks",
"offer": "f5-big-iq",
"sku": "f5-bigiq-virtual-edition-byol",
"version": "latest"
},
"osDisk": {
"osType": "Linux",
"name": "[concat(parameters('virtualMachines_myCurrentVM_name'), '_OsDisk_1_xxxxxx')]",
"createOption": "FromImage",
"caching": "ReadWrite",
"managedDisk": {
"storageAccountType": "StandardSSD_LRS",
"id": "[parameters('disks_myCurrentVM_OsDisk_1_xxxxxx_externalid')]"
},
"deleteOption": "Detach",
"diskSizeGB": 120
},
"dataDisks": [
{
"lun": 0,
"name": "[concat(parameters('virtualMachines_myCurrentVM_name'), '_DataDisk_0')]",
"createOption": "Attach",
"caching": "ReadOnly",
"writeAcceleratorEnabled": false,
"managedDisk": {
"storageAccountType": "StandardSSD_LRS",
"id": "[parameters('disks_myCurrentVM_DataDisk_0_externalid')]"
},
"deleteOption": "Detach",
"diskSizeGB": 128,
"toBeDetached": false
}
]
},
"osProfile": {
"computerName": "[parameters('virtualMachines_myCurrentVM_name')]",
"adminUsername": "azureuser",
"linuxConfiguration": {
"disablePasswordAuthentication": true,
"ssh": {
"publicKeys": [
{
"path": "/home/azureuser/.ssh/authorized_keys",
"keyData": "ssh-rsa <some key here>"
}
]
},
"provisionVMAgent": true,
"patchSettings": {
"patchMode": "ImageDefault",
"assessmentMode": "ImageDefault"
}
},
"secrets": [],
"allowExtensionOperations": true,
"requireGuestProvisionSignal": true
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[parameters('networkInterfaces_myCurrentVM290_externalid')]"
}
]
},
"diagnosticsProfile": {
"bootDiagnostics": {
"enabled": true
}
}
}
}
]
}
Is it the best way to edit and modify the JSON file, or there is another way to do this? Thanks!
Thank you Matan Shabtay. Posting your suggestion as answer to help other community members.
From deployment Section (of the resource group where the VM is currently residing) you would get deployment history. Use that templet to replicate your your VM.
Select the resource group you want to examine.
Select the link under Deployments.
Select one of the deployments from the deployment history.
You can use the view templet option
Reference: https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/deployment-history?tabs=azure-portal
Related
I'm totally new to azure, my intention was to test a bit to validate if worth or not.
My goal would be to virtualize a desktop at the moment just for introduction reasons.
So, I started an azure free account, followed the first steps to start an azure AD Domain service, afterwards I tried to add a new ressource to create a vm with provisioning a hostpool.
It failed giving me an array joindomain provisioning failed.
I did it just via the portal following the azure documentation til create a tenant, I of course used also the PS commands, afterwards I followed the introduction to create a hostpool.
I used a new ressource group and the existing vnet.
Here also the script the portal gave me for downloading:
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"virtualMachines_acme_0_name": {
"defaultValue": "acme-0",
"type": "String"
},
"availabilitySets_ACME_AVAILABILITYSET_externalid": {
"defaultValue": "/subscriptions/c7c46e95-26bf-4666-a146-9427080e4ee2/resourceGroups/ACME/providers/Microsoft.Compute/availabilitySets/ACME-AVAILABILITYSET",
"type": "String"
},
"disks_acme_0_OsDisk_1_86a929acf8b14d85b34543064a89be09_externalid": {
"defaultValue": "/subscriptions/c7c46e95-26bf-4666-a146-9427080e4ee2/resourceGroups/ACME/providers/Microsoft.Compute/disks/acme-0_OsDisk_1_86a929acf8b14d85b34543064a89be09",
"type": "String"
},
"networkInterfaces_acme_0_nic_externalid": {
"defaultValue": "/subscriptions/c7c46e95-26bf-4666-a146-9427080e4ee2/resourceGroups/ACME/providers/Microsoft.Network/networkInterfaces/acme-0-nic",
"type": "String"
}
},
"variables": {},
"resources": [
{
"type": "Microsoft.Compute/virtualMachines",
"apiVersion": "2019-07-01",
"name": "[parameters('virtualMachines_acme_0_name')]",
"location": "southcentralus",
"properties": {
"availabilitySet": {
"id": "[parameters('availabilitySets_ACME_AVAILABILITYSET_externalid')]"
},
"hardwareProfile": {
"vmSize": "Standard_B1ms"
},
"storageProfile": {
"imageReference": {
"publisher": "MicrosoftWindowsDesktop",
"offer": "office-365",
"sku": "19h2-evd-o365pp",
"version": "latest"
},
"osDisk": {
"osType": "Windows",
"name": "[concat(parameters('virtualMachines_acme_0_name'), '_OsDisk_1_86a929acf8b14d85b34543064a89be09')]",
"createOption": "FromImage",
"caching": "ReadWrite",
"managedDisk": {
"storageAccountType": "Standard_LRS",
"id": "[parameters('disks_acme_0_OsDisk_1_86a929acf8b14d85b34543064a89be09_externalid')]"
},
"diskSizeGB": 127
},
"dataDisks": []
},
"osProfile": {
"computerName": "[parameters('virtualMachines_acme_0_name')]",
"adminUsername": "chris",
"windowsConfiguration": {
"provisionVMAgent": true,
"enableAutomaticUpdates": true
},
"secrets": [],
"allowExtensionOperations": true,
"requireGuestProvisionSignal": true
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[parameters('networkInterfaces_acme_0_nic_externalid')]"
}
]
},
"diagnosticsProfile": {
"bootDiagnostics": {
"enabled": false
}
},
"licenseType": "Windows_Client"
}
}
]
}
And this is the error in extensions/joindomain
[
{
"code": "ComponentStatus/JoinDomainException for Option 3 meaning 'User Specified'/failed/1",
"level": "Error",
"displayStatus": "Provisioning failed",
"message": "ERROR - Failed to join domain='cheyenneitoutlook.onmicrosoft.com', ou='', user='chris#cheyenneitoutlook.onmicrosoft.com', option='NetSetupJoinDomain, NetSetupAcctCreate' (#3 meaning 'User Specified'). Error code 1355"
},
{
"code": "ComponentStatus/JoinDomainException for Option 1 meaning 'User Specified without NetSetupAcctCreate'/failed/1",
"level": "Error",
"displayStatus": "Provisioning failed",
"message": "ERROR - Failed to join domain='cheyenneitoutlook.onmicrosoft.com', ou='', user='chris#cheyenneitoutlook.onmicrosoft.com', option='NetSetupJoinDomain' (#1 meaning 'User Specified without NetSetupAcctCreate'). Error code 1355"
}
]
Any help with explaation what I did wrong is appreciated.
Your VMS cannot find or connect to the Azure AD DS managed domain. Take a look to Connectivity issues for domain-join and Connectivity issues.
I have an application that is incompatible with the latest dot net framework coming with the latest Microsoft image. I want to use the older Microsoft image and exclude .net framework update.
Ask:
I want my machines to be patched then if I choose the VMSS automatic update or roll-up; How can I make sure on every new instance I don't get that .net framework update (specific KB)
If I understand the question, you have a scaleset that is created from a standard image. You apply the specific .Net framework. You then deploy your app.
Option 1: Simplest and Preferred - Edit app config file to use specific .Net Framework (so it works regardless of installed framework(s)). Below config will run your app under 2.0.50727 framework, regardless of patches.
<configuration>
<startup>
<supportedRuntime version="v2.0.50727"/>
</startup>
</configuration
Option 2: I think you will need to create a OS VM with the configuration you want. Then periodically create a new image from that VM with the various patches. It is possible to maintain a baseline VM and create images from a clone. In this scenario, I think you really have a "Windows Update" issue in wanting to block a specific patch. Then re-image your scaleset from the resulting image. This template creates a VMSS from a specific iamge:
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"type": "string"
},
"vmssName": {
"type": "string"
},
"vmSku": {
"type": "string"
},
"adminUsername": {
"type": "string"
},
"instanceCount": {
"type": "string"
},
"singlePlacementGroup": {
"type": "string"
},
"pipName": {
"type": "string"
},
"pipLabel": {
"type": "string"
},
"skuType": {
"type": "string"
},
"ipAllocationMethod": {
"type": "string"
},
"priority": {
"type": "string"
},
"enableAcceleratedNetworking": {
"type": "string"
},
"publicIpAddressPerInstance": {
"type": "string"
},
"upgradeMode": {
"type": "string"
},
"adminPassword": {
"type": "securestring"
},
"spreadingAlgorithmPlatformFaultDomainCount": {
"type": "string"
},
"diagnosticStorageAccount": {
"type": "string"
},
//vNet
"vnetResourceGroup": {
"type": "string",
"defaultValue": "xxxxx"
},
"vnetName": {
"type": "string",
"defaultValue": "xxxxx"
},
"vnetSubnetName": {
"type": "string",
"defaultValue": "xxxxx"
},
//vm OS Image
"imageSubscription": {
"type": "string",
"defaultValue": "xxxxx-xxxx-xxxx-xxxx-xxxxx"
},
"imageResourceGroup": {
"type": "string",
"defaultValue": "xxxxx"
},
"imageName": {
"type": "string",
"defaultValue": "xxxxx_eastus_2019_11_21_18_21_29"
},
"domainName": {
"type": "string",
"defaultValue": "xxxxx.net"
},
"userName": {
"type": "string",
"defaultValue": "xxxxx",
"metadata": {
"description": "Do not use domainName here. domainName\\userName are concatenated at runtime."
}
},
"userPassword": {
"type": "securestring",
"defaultValue": "xxxxxxxxxxxxxxxxxx"
},
"ouPath": {
"type": "string",
"defaultValue": "OU=xx,DC=xxx,DC=xxxx,DC=net",
"metadata": {
"description": "Fully qualified path works."
}
},
"restart": {
"type": "string",
"defaultValue": "true",
"metadata": {
"description": "VM will restart, UNLESS account already esists in domain. This may impact a configuration sequence during deployment. This extension can remove the account when removing a machine from the domain, (according to the documentation)."
}
},
"options": {
"type": "string",
"defaultValue": "3",
"metadata": {
"description": "Extension uses NetJoinDomain Win32 API. Options is a OR mask documented in url below. ie '3' = NETSETUP_JOIN_DOMAIN & NETSETUP_ACCT_CREATE. ",
"url": "https://learn.microsoft.com/en-us/windows/win32/api/lmjoin/nf-lmjoin-netjoindomain"
}
},
"forceUpdateTag": {
"defaultValue": "[newGuid()]",
"type": "string",
"metadata": {
"description": "Forces extension to deploy every time."
}
}
},
"variables": {
"namingInfix": "[toLower(substring(concat(parameters('vmssName'), uniqueString(resourceGroup().id)), 0, 9))]",
"networkApiVersion": "2018-01-01",
"storageApiVersion": "2019-06-01",
"computeApiVersion": "2019-03-01",
"autoscaleApiVersion": "2015-04-01",
"subnetRef": "[resourceId(parameters('vnetResourceGroup'), 'Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('vnetSubnetName') )]",
"imageReferenceId": "[resourceId( parameters('imageSubscription'), parameters('imageResourceGroup'), 'Microsoft.Compute/images', parameters('imageName') )]"
},
"resources": [
{
"type": "Microsoft.Compute/virtualMachineScaleSets",
"apiVersion": "[variables('computeApiVersion')]",
"name": "[parameters('vmssName')]",
"location": "[parameters('location')]",
"dependsOn": [
],
"sku": {
"name": "[parameters('vmSku')]",
"tier": "Standard",
"capacity": "[int(parameters('instanceCount'))]"
},
"identity": {
"type": "SystemAssigned"
},
"properties": {
"overprovision": true,
"upgradePolicy": {
"mode": "[parameters('upgradeMode')]"
},
"singlePlacementGroup": "[parameters('singlePlacementGroup')]",
"virtualMachineProfile": {
"extensionProfile": {
"extensions": [
{
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "[concat(parameters('vmssName'), '_joindomain')]",
"properties": {
"publisher": "Microsoft.Compute",
"type": "JsonADDomainExtension",
"typeHandlerVersion": "1.3",
"autoUpgradeMinorVersion": true,
"forceUpdateTag": "[parameters('forceUpdateTag')]",
"settings": {
"Name": "[parameters('domainName')]",
"User": "[ concat( parameters('domainName'), '\u005c', parameters('userName') ) ]",
"OUPath": "[parameters('ouPath')]",
"Restart": "[parameters('restart')]",
"Options": "[parameters('options')]"
},
"protectedSettings": {
"Password": "[parameters('userPassword')]"
}
}
}
]
},
"storageProfile": {
"imageReference": {
"id": "[variables('imageReferenceId')]"
},
"osDisk": {
"createOption": "FromImage",
"caching": "ReadWrite"
}
},
"priority": "[parameters('priority')]",
"osProfile": {
"computerNamePrefix": "[variables('namingInfix')]",
"adminUsername": "[parameters('adminUsername')]",
"adminPassword": "[parameters('adminPassword')]"
},
"networkProfile": {
"networkInterfaceConfigurations": [
{
"name": "[concat(parameters('vmssName'), 'Nic')]",
"properties": {
"primary": true,
"enableAcceleratedNetworking": "[parameters('enableAcceleratedNetworking')]",
"ipConfigurations": [
{
"name": "[concat(parameters('vmssName'), 'IpConfig')]",
"properties": {
"subnet": {
"id": "[variables('subnetRef')]"
}
}
}
],
"dnsSettings": {
"dnsServers": [
"xx.xx.xx.xx"
]
}
}
}
]
},
"diagnosticsProfile": {
"bootDiagnostics": {
"enabled": true,
"storageUri": "[reference(parameters('diagnosticStorageAccount'), variables('storageApiVersion')).primaryEndpoints.blob]"
}
}
},
"platformFaultDomainCount": "[int(parameters('spreadingAlgorithmPlatformFaultDomainCount'))]"
}
}
]
}
I have problem when creating my custom template. I am trying to create VM from vhd as vhd but in deployment it fail with error osProfile missing. It is interesting because in other template from internet I see there is no osprofile section and it is deploying without problems.
So I added osProfile with computerName parameter. But now deployment failing with error there is adminUsername and adminPassword needed. I don´t understand how is possible that in another script this is not requied and it will create VM without problems.
There is also fact that my template is creating VM using vhd but that other template is creating VM using managed disk. Is this possibly problematic?
My piece of code:
"apiVersion": "2017-03-30",
"type": "Microsoft.Compute/virtualMachines",
"name": "[parameters('vmName')]",
"location": "[parameters('location')]",
"dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
],
"properties": {
"hardwareProfile": {
"vmSize": "[parameters('vmSize')]"
},
"osProfile": {
"computerName": "[concat(parameters('vmName'))]",
"adminUsername": "",
"adminPassword": ""
},
"storageProfile": {
"osDisk": {
"name": "[concat(parameters('vmName'),'-osDisk')]",
"osType": "[parameters('osType')]",
"caching": "ReadWrite",
"image": {
"uri": "[parameters('osVhdUri')]"
},
"vhd": {
"uri": "[variables('osDiskVhdName')]"
},
"createOption": "FromImage"
}
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces',variables('nicName'))]"
}
]
},
"diagnosticsProfile": {
"bootDiagnostics": {
"enabled": true,
"storageUri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/', parameters('userDiagStorageAccountName')), '2016-01-01').primaryEndpoints.blob)]"
}
}
I know adminUsername and adminPassword can´t be empty but I don´t want this parameters in creating VM from existing vhd.
Piece of template code from deployment successful:
"apiVersion": "2017-03-30",
"type": "Microsoft.Compute/virtualMachines",
"name": "[parameters('vmName')]",
"location": "[parameters('location')]",
"tags": {
"displayName": "VirtualMachine"
},
"dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]",
"[concat(parameters('vmName'), '_OSdisk')]",
"[concat(parameters('vmName'), '_Datadisk')]"
],
"properties": {
"hardwareProfile": {
"vmSize": "[parameters('vmSize')]"
},
"storageProfile": {
"osDisk": {
"osType": "[parameters('osType')]",
"caching": "ReadWrite",
"createOption": "Attach",
"managedDisk": {
"id": "[resourceId('Microsoft.Compute/disks', concat(parameters('vmName'), '_OSdisk'))]"
}
},
"dataDisks": [
{
"lun": 0,
"managedDisk": {
"id": "[resourceId('Microsoft.Compute/disks', concat(parameters('vmName'), '_Datadisk'))]"
},
"caching": "ReadOnly",
"createOption": "Attach"
}
]
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces',variables('nicName'))]"
}
]
},
"diagnosticsProfile": {
"bootDiagnostics": {
"enabled": true,
"storageUri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('diagStorageAccountName')), '2016-01-01').primaryEndpoints.blob)]"
}
}
Here is printscreen of failed deployment without osProfile form my template.
change "createOption": "FromImage" to "createOption": "Attach". You are trying to create a VM from marketplace image, not from existing VHD.
in this case you can remove osProfile completely
I created a VM manually in Azure then used the automation script to generate a template to use from Visual Studio for a deployment however when I try to deploy it everything else works bar the VM which complains about the osProfile parameter, If I remove the osProfile section the deployment works but creates a VM I have no way to login to, all the examples I find say the osProfile I have should be fine so I'm a bit stuck
The template attached only works when the osProfile is commented out and then you can't login to the VM
Appreciate any suggestions as I've tried all sorts and am stumped now!
This is the error when the osProfile is included:
08:58:16 - Template deployment returned the following errors:
08:58:16 - 08:58:15 - Resource Microsoft.Compute/virtualMachines 'TheFaireyDevSolr' failed with message '{
08:58:16 - "error": {
08:58:16 - "code": "InvalidParameter",
08:58:16 - "target": "osProfile",
08:58:16 - "message": "Parameter 'osProfile' is not allowed."
08:58:16 - }
08:58:16 - }'
I updated the Password parameter to something more complex that I know meets the min reqs.
Below is the template json
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"adminUsername": {
"type": "string",
"minLength": 1,
"metadata": {
"description": "User name for the Virtual Machine."
}
},
"adminPassword": {
"type": "securestring",
"metadata": {
"description": "Password for the Virtual Machine."
}
},
"disks_TheFaireyDevSolrDataDisk_name": {
"type": "string"
},
"disks_TheFaireyDevSolrOsDisk_name": {
"type": "string"
},
"virtualMachines_TheFaireyDevSolr_name": {
"type": "string"
},
"networkInterfaces_thefaireydevsolr_ni_name": {
"type": "string"
},
"networkSecurityGroups_TheFaireyDevSolr_nsg_name": {
"type": "string"
},
"publicIPAddresses_TheFaireyDevSolr_ip_name": {
"type": "string"
},
"virtualNetworks_TheFaireyDev_vnet_name": {
"type": "string"
},
"storageAccounts_thefaireydevmainstorage_name": {
"type": "string"
},
"extensions_Microsoft.Insights.VMDiagnosticsSettings_name": {
"type": "string"
}
},
"resources": [
{
"type": "Microsoft.Compute/disks",
"name": "[parameters('disks_TheFaireyDevSolrDataDisk_name')]",
"apiVersion": "2016-04-30-preview",
"location": "[resourceGroup().location]",
"scale": null,
"properties": {
"accountType": "Standard_LRS",
"creationData": {
"createOption": "Empty"
},
"diskSizeGB": 32
},
"dependsOn": []
},
{
"type": "Microsoft.Compute/disks",
"name": "[parameters('disks_TheFaireyDevSolrOsDisk_name')]",
"apiVersion": "2016-04-30-preview",
"location": "[resourceGroup().location]",
"scale": null,
"properties": {
"accountType": "Standard_LRS",
"osType": "Linux",
"creationData": {
"createOption": "FromImage",
"imageReference": {
"id": "/Subscriptions/<YOUR SUBSCRIPTION ID>/Providers/Microsoft.Compute/Locations/uksouth/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/17.04/Versions/latest"
}
},
"diskSizeGB": 30
},
"dependsOn": []
},
{
"type": "Microsoft.Compute/virtualMachines",
"name": "[parameters('virtualMachines_TheFaireyDevSolr_name')]",
"apiVersion": "2016-04-30-preview",
"location": "[resourceGroup().location]",
"scale": null,
"properties": {
"hardwareProfile": {
"vmSize": "Standard_A1_v2"
},
"storageProfile": {
"osDisk": {
"osType": "Linux",
"name": "[parameters('disks_TheFaireyDevSolrOSDisk_name')]",
"createOption": "Attach",
"caching": "ReadWrite",
"managedDisk": {
"storageAccountType": "Standard_LRS",
"id": "[resourceId('Microsoft.Compute/disks', parameters('disks_TheFaireyDevSolrOsDisk_name'))]"
},
"diskSizeGB": 30
},
"dataDisks": [
{
"lun": 0,
"name": "[concat(parameters('virtualMachines_TheFaireyDevSolr_name'),'DataDisk')]",
"createOption": "Attach",
"caching": "None",
"managedDisk": {
"storageAccountType": "Standard_LRS",
"id": "[resourceId('Microsoft.Compute/disks', parameters('disks_TheFaireyDevSolrDataDisk_name'))]"
},
"diskSizeGB": 32
}
]
},
"osProfile": {
"computerName": "[parameters('virtualMachines_TheFaireyDevSolr_name')]",
"adminUsername": "[parameters('adminUsername')]",
"adminPassword": "[parameters('adminPassword')]"
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('networkInterfaces_thefaireydevsolr_ni_name'))]"
}
]
},
"diagnosticsProfile": {
"bootDiagnostics": {
"enabled": true,
"storageUri": "[concat('https', '://', parameters('storageAccounts_thefaireydevmainstorage_name'), '.blob.core.windows.net', '/')]"
}
}
},
"dependsOn": [
"[resourceId('Microsoft.Compute/disks', parameters('disks_TheFaireyDevSolrOsDisk_name'))]",
"[resourceId('Microsoft.Compute/disks', parameters('disks_TheFaireyDevSolrDataDisk_name'))]",
"[resourceId('Microsoft.Network/networkInterfaces', parameters('networkInterfaces_thefaireydevsolr_ni_name'))]",
"[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccounts_thefaireydevmainstorage_name'))]"
]
},
{
"type": "Microsoft.Network/networkInterfaces",
"name": "[parameters('networkInterfaces_thefaireydevsolr_ni_name')]",
"apiVersion": "2017-03-01",
"location": "[resourceGroup().location]",
"scale": null,
"properties": {
"ipConfigurations": [
{
"name": "ipconfig1",
"properties": {
"privateIPAddress": "10.0.0.4",
"privateIPAllocationMethod": "Dynamic",
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddresses_TheFaireyDevSolr_ip_name'))]"
},
"subnet": {
"id": "[concat(resourceId('Microsoft.Network/virtualNetworks', parameters('virtualNetworks_TheFaireyDev_vnet_name')), '/subnets/default')]"
}
}
}
],
"dnsSettings": {
"dnsServers": []
},
"enableIPForwarding": false,
"networkSecurityGroup": {
"id": "[resourceId('Microsoft.Network/networkSecurityGroups', parameters('networkSecurityGroups_TheFaireyDevSolr_nsg_name'))]"
}
},
"dependsOn": [
"[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddresses_TheFaireyDevSolr_ip_name'))]",
"[resourceId('Microsoft.Network/virtualNetworks', parameters('virtualNetworks_TheFaireyDev_vnet_name'))]",
"[resourceId('Microsoft.Network/networkSecurityGroups', parameters('networkSecurityGroups_TheFaireyDevSolr_nsg_name'))]"
]
},
{
"type": "Microsoft.Network/networkSecurityGroups",
"name": "[parameters('networkSecurityGroups_TheFaireyDevSolr_nsg_name')]",
"apiVersion": "2017-03-01",
"location": "[resourceGroup().location]",
"scale": null,
"properties": {
"securityRules": [
{
"name": "default-allow-ssh",
"properties": {
"protocol": "Tcp",
"sourcePortRange": "*",
"destinationPortRange": "22",
"sourceAddressPrefix": "*",
"destinationAddressPrefix": "*",
"access": "Allow",
"priority": 1000,
"direction": "Inbound"
}
}
]
},
"dependsOn": []
},
{
"type": "Microsoft.Network/publicIPAddresses",
"name": "[parameters('publicIPAddresses_TheFaireyDevSolr_ip_name')]",
"apiVersion": "2017-03-01",
"location": "[resourceGroup().location]",
"scale": null,
"properties": {
"publicIPAllocationMethod": "Dynamic",
"idleTimeoutInMinutes": 4
},
"dependsOn": []
},
{
"type": "Microsoft.Network/virtualNetworks",
"name": "[parameters('virtualNetworks_TheFaireyDev_vnet_name')]",
"apiVersion": "2017-03-01",
"location": "[resourceGroup().location]",
"scale": null,
"properties": {
"addressSpace": {
"addressPrefixes": [
"10.0.0.0/24"
]
},
"subnets": [
{
"name": "default",
"properties": {
"addressPrefix": "10.0.0.0/24"
}
}
],
"virtualNetworkPeerings": []
},
"dependsOn": []
},
{
"type": "Microsoft.Storage/storageAccounts",
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"kind": "Storage",
"name": "[parameters('storageAccounts_thefaireydevmainstorage_name')]",
"apiVersion": "2016-01-01",
"location": "[resourceGroup().location]",
"tags": {},
"scale": null,
"properties": {},
"dependsOn": []
},
//{
// "type": "Microsoft.Compute/virtualMachines/extensions",
// "name": "[parameters('extensions_Microsoft.Insights.VMDiagnosticsSettings_name')]",
// "apiVersion": "2016-04-30-preview",
// "location": "[resourceGroup().location]",
// "scale": null,
// "properties": {
// "publisher": "Microsoft.OSTCExtensions",
// "type": "LinuxDiagnostic",
// "typeHandlerVersion": "2.3",
// "autoUpgradeMinorVersion": true,
// "settings": {
// "xmlCfg": "PFdhZENmZz48RGlhZ25vc3RpY01vbml0b3JDb25maWd1cmF0aW9uIG92ZXJhbGxRdW90YUluTUI9IjQwOTYiPjxEaWFnbm9zdGljSW5mcmFzdHJ1Y3R1cmVMb2dzIHNjaGVkdWxlZFRyYW5zZmVyUGVyaW9kPSJQVDFNIiBzY2hlZHVsZWRUcmFuc2ZlckxvZ0xldmVsRmlsdGVyPSJXYXJuaW5nIi8+PFBlcmZvcm1hbmNlQ291bnRlcnMgc2NoZWR1bGVkVHJhbnNmZXJQZXJpb2Q9IlBUMU0iPjxQZXJmb3JtYW5jZUNvdW50ZXJDb25maWd1cmF0aW9uIGNvdW50ZXJTcGVjaWZpZXI9IlxNZW1vcnlcQXZhaWxhYmxlTWVtb3J5IiBzYW1wbGVSYXRlPSJQVDE1UyIgdW5pdD0iQnl0ZXMiPjxhbm5vdGF0aW9uIGRpc3BsYXlOYW1lPSJNZW1vcnkgYXZhaWxhYmxlIiBsb2NhbGU9ImVuLXVzIi8+PC9QZXJmb3JtYW5jZUNvdW50ZXJDb25maWd1cmF0aW9uPjxQZXJmb3JtYW5jZUNvdW50ZXJDb25maWd1cmF0aW9uIGNvdW50ZXJTcGVjaWZpZXI9IlxNZW1vcnlcUGVyY2VudEF2YWlsYWJsZU1lbW9yeSIgc2FtcGxlUmF0ZT0iUFQxNVMiIHVuaXQ9IlBlcmNlbnQiPjxhbm5vdGF0aW9uIGRpc3BsYXlOYW1lPSJNZW0uIHBlcmNlbnQgYXZhaWxhYmxlIiBsb2NhbGU9ImVuLXVzIi8+PC9QZXJmb3JtYW5jZUNvdW50ZXJDb25maWd1cmF0aW9uPjxQZXJmb3JtYW5jZUNvdW50ZXJDb25maWd1cmF0aW9uIGNvdW50ZXJTcGVjaWZpZXI9IlxNZW1vcnlcVXNlZ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bGF5TmFtZT0iUGFja2V0cyBzZW50IGVycm9ycyIgbG9jYWxlPSJlbi11cyIvPjwvUGVyZm9ybWFuY2VDb3VudGVyQ29uZmlndXJhdGlvbj48UGVyZm9ybWFuY2VDb3VudGVyQ29uZmlndXJhdGlvbiBjb3VudGVyU3BlY2lmaWVyPSJcTmV0d29ya0ludGVyZmFjZVxUb3RhbENvbGxpc2lvbnMiIHNhbXBsZVJhdGU9IlBUMTVTIiB1bml0PSJDb3VudCI+PGFubm90YXRpb24gZGlzcGxheU5hbWU9Ik5ldHdvcmsgY29sbGlzaW9ucyIgbG9jYWxlPSJlbi11cyIvPjwvUGVyZm9ybWFuY2VDb3VudGVyQ29uZmlndXJhdGlvbj48L1BlcmZvcm1hbmNlQ291bnRlcnM+PE1ldHJpY3MgcmVzb3VyY2VJZD0iL3N1YnNjcmlwdGlvbnMvNDkyMzY4ZWEtYTA2Mi00MGQ0LWI2YjUtZTU0ZGI5YTkxZDA2L3Jlc291cmNlR3JvdXBzL0F4aW9tRGV2L3Byb3ZpZGVycy9NaWNyb3NvZnQuQ29tcHV0ZS92aXJ0dWFsTWFjaGluZXMvQXhpb21EZXZTb2xyIj48TWV0cmljQWdncmVnYXRpb24gc2NoZWR1bGVkVHJhbnNmZXJQZXJpb2Q9IlBUMUgiLz48TWV0cmljQWdncmVnYXRpb24gc2NoZWR1bGVkVHJhbnNmZXJQZXJpb2Q9IlBUMU0iLz48L01ldHJpY3M+PC9EaWFnbm9zdGljTW9uaXRvckNvbmZpZ3VyYXRpb24+PC9XYWRDZmc+"
// },
// "protectedSettings": {}
// },
// "dependsOn": [
// "[resourceId('Microsoft.Compute/virtualMachines', parameters('virtualMachines_TheFaireyDevSolr_name'))]"
// ]
//}
],
"variables": {}
}
and the parameters json
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"adminUsername": {
"value": "thefairey"
},
"disks_TheFaireyDevSolrDataDisk_name": {
"value": "TheFaireyDevSolrDataDisk"
},
"disks_TheFaireyDevSolrOsDisk_name": {
"value": "TheFaireyDevSolrOsDisk"
},
"virtualMachines_TheFaireyDevSolr_name": {
"value": "TheFaireyDevSolr"
},
"networkInterfaces_thefaireydevsolr_ni_name": {
"value": "TheFaireyDevSolr-ni"
},
"networkSecurityGroups_TheFaireyDevSolr_nsg_name": {
"value": "TheFaireyDevSolr-nsg"
},
"publicIPAddresses_TheFaireyDevSolr_ip_name": {
"value": "TheFaireyDevSolr-ip"
},
"virtualNetworks_TheFaireyDev_vnet_name": {
"value": "TheFaireyDev-vnet"
},
"storageAccounts_thefaireydevmainstorage_name": {
"value": "thefaireydevmainstorage"
},
"extensions_Microsoft.Insights.VMDiagnosticsSettings_name": {
"value": "TheFaireyDevSolr/Microsoft.Insights.VMDiagnosticsSettings"
}
}
}
UPDATE
I started with a plain Ubuntu VM template from VS and started adding stuff and the problem regarding the osProfile starts happening as soon as I try to add a Managed Disk as the OS disk, I removed that but tried with a managed disk for the DataDisk and got the error "Addition of a managed disk to a VM with blob based disks is not supported"
Not sure if it helps but I believe the issue may be related to having a Managed Disk as the OS disk. Will continue to research and experiment!
Ok worked it out, the automation script I guess isn't quite up to speed with Managed Disks which is fair enough as they are in preview, when I ran it it created a separate resource for the OS Managed disk.
In order to have a managed disk as the OS disk you need to define the storageProfile as follows:
"storageProfile": {
"imageReference": {
"publisher": "[variables('imagePublisher')]",
"offer": "[variables('imageOffer')]",
"sku": "[parameters('ubuntuOSVersion')]",
"version": "latest"
},
"osDisk": {
"osType": "Linux",
"name": "YourOSDiskName",
"createOption": "FromImage",
"caching": "ReadWrite",
"managedDisk": {
"storageAccountType": "Standard_LRS"
},
"diskSizeGB": 32
},
}
The important thing is that you don't need to define the managed disk as a separate resource, it appears the VM creation handles creation of the Managed disk resource and you just need to specify the storageAccountType for the disk.
After that everything appears to work correctly.
Trying to Attach a previously defined Managed Disk based on an OS image and specifying the id parameter in the managedDisk settings in the VM doesn't appear to work.
Hope this helps someone!
osProfile is required if the VHD is sysprepped & generalized - meaning when it starts you want to run through first time setup. If the image is not generalized then you can't specify the osProfile (e.g. user/pass) because it already exists.
re: ManagedDisks - you can use an implicit disk or explicit. If you wanted to use one of your own disk images your storageProfile would be:
"storageProfile": {
"imageReference": {
"id": "[parameters('imageResourceId')]"
}
}
If you want to use your own disk (say, created from a snapshot) you would use:
"storageProfile": {
"osDisk": {
"osType": "[parameters('osType')]",
"name": "[parameters('managedOsDiskName')]",
"createOption": "Attach",
"managedDisk": {
"id": "[resourceId('Microsoft.Compute/disks', parameters('managedOsDiskName'))]"
},
"caching": "ReadWrite"
}
}
There are a lot of options available w/ managed disks... This doc isn't perfect but does help.
Below mentioned API is used to invoke all virtual machines :
https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines?api-version=2015-06-15
In the response of virtual machines, virtual machine Id as mentioned here
"id": "/subscriptions/subscriptonId/resourceGroups/AGILITY/providers/Microsoft.Compute/virtualMachines/ProxyDontDelete10001",
in which resource group name is in Capital Letters (AGILITY) and if we invoke another rest api using this ID to get the instance view details it's not working.
/providers/Microsoft.Compute/virtualMachines/i-00000009/InstanceView
{
"value": [
{
"properties": {
"vmId": "7eb8dca3-dacf-4c51-b079-a508bf6d02b9",
"hardwareProfile": {
"vmSize": "Basic_A0"
},
"storageProfile": {
"osDisk": {
"osType": "Linux",
"name": "ProxyDontDelete10001",
"createOption": "FromImage",
"image": {
"uri": "https://blob.blob.core.windows.net/vhd/SM-RHEL6.7s-x64-9.2.r1664-20150801.vhd"
},
"vhd": {
"uri": "https://blob.blob.core.windows.net/vhds/ProxyDontDelete10001_ee751938-8d5c-468b-a36f-63e5332405cf.vhd"
},
"caching": "ReadWrite"
},
"dataDisks": [],
},
"osProfile": {
"computerName": "ProxyDontDelete10001",
"adminUsername": "admin",
"linuxConfiguration": {
"disablePasswordAuthentication": false
},
"secrets": [],
},
"networkProfile": {
"networkInterfaces": [
{
"id": "/subscriptions/{subscriptionId}/resourceGroups/test/providers/Microsoft.Network/networkInterfaces/testProxyDontDelete10001_ee751938-8d5c-468b-a36f-63e5332405cf"
}
],
},
"provisioningState": "Succeeded"
},
"type": "Microsoft.Compute/virtualMachines",
"location": "westus",
"id": "/subscriptions/subscriptonId/resourceGroups/AGILITY/providers/Microsoft.Compute/virtualMachines/ProxyDontDelete10001",
"name": "ProxyDontDelete10001"
},
Ok, I'm not sure I entirely understand the question, but resource group name is not case sensitive, so doing to:
/subscriptions/subscriptonId/resourceGroups/agility/providers/Microsoft.Compute/virtualMachines/ProxyDontDelete10001
should also work.