forked from Azure/azure-quickstart-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Azure#708 from bjoervik/patch-1
201-specialized-vm-existing-vnet
- Loading branch information
Showing
4 changed files
with
204 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Prerequisites: | ||
- URL to the existing VHD file in ether a premium or standard storage account. | ||
- Name of the existing VNET and subnet you want to connect the new virtual machine to. | ||
- Name of the Resource Group that the VNET resides in. | ||
|
||
This template creates a VM from a specialized VHD and let you connect it to an existing VNET that can reside in another Resource Group then the virtual machine. | ||
|
||
Plese note: This deployment template does not create or attach an existing Network Security Group to the virtual machine. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
"location": { | ||
"type": "string", | ||
"metadata": { | ||
"description": "Please enter the location where you want to deploy this VM" | ||
} | ||
}, | ||
"vmName": { | ||
"type": "string", | ||
"metadata": { | ||
"description": "Name of the VM" | ||
} | ||
}, | ||
"osType": { | ||
"type": "string", | ||
"allowedValues": [ | ||
"Windows", | ||
"Linux" | ||
], | ||
"metadata": { | ||
"description": "Type of OS on the existing vhd" | ||
} | ||
}, | ||
"osDiskVhdUri": { | ||
"type": "string", | ||
"metadata": { | ||
"description": "Uri of the existing VHD in ARM standard or premium storage" | ||
} | ||
}, | ||
"vmSize": { | ||
"type": "string", | ||
"metadata": { | ||
"description": "Size of the VM" | ||
} | ||
}, | ||
"existingVirtualNetworkName": { | ||
"type": "string", | ||
"metadata": { | ||
"description": "Name of the existing VNET" | ||
} | ||
}, | ||
"existingVirtualNetworkResourceGroup": { | ||
"type": "string", | ||
"metadata": { | ||
"description": "Name of the existing VNET resource group" | ||
} | ||
}, | ||
"subnetName": { | ||
"type": "string", | ||
"metadata": { | ||
"description": "Name of the subnet in the virtual network you want to use" | ||
} | ||
}, | ||
"dnsNameForPublicIP": { | ||
"type": "string", | ||
"metadata": { | ||
"description": "Unique DNS Name for the Public IP used to access the Virtual Machine." | ||
} | ||
} | ||
|
||
}, | ||
"variables": { | ||
"api-version": "2015-06-15", | ||
"publicIPAddressType": "Dynamic", | ||
"vnetID": "[resourceId(parameters('existingVirtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', parameters('existingVirtualNetworkName'))]", | ||
"subnetRef": "[concat(variables('vnetID'),'/subnets/', parameters('subnetName'))]", | ||
"nicName": "[parameters('vmName')]", | ||
"publicIPAddressName": "[parameters('vmName')]" | ||
}, | ||
"resources": [ | ||
{ | ||
"apiVersion": "[variables('api-version')]", | ||
"type": "Microsoft.Network/publicIPAddresses", | ||
"name": "[variables('publicIPAddressName')]", | ||
"location": "[parameters('location')]", | ||
"tags": { | ||
"displayName": "PublicIPAddress" | ||
}, | ||
"properties": { | ||
"publicIPAllocationMethod": "[variables('publicIPAddressType')]", | ||
"dnsSettings": { | ||
"domainNameLabel": "[parameters('dnsNameForPublicIP')]" | ||
} | ||
} | ||
}, | ||
{ | ||
"apiVersion": "[variables('api-version')]", | ||
"type": "Microsoft.Network/networkInterfaces", | ||
"name": "[variables('nicName')]", | ||
"location": "[parameters('location')]", | ||
"dependsOn": [ | ||
"[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]" | ||
], | ||
"tags": { | ||
"displayName": "NetworkInterface" | ||
}, | ||
"properties": { | ||
"ipConfigurations": [ | ||
{ | ||
"name": "ipconfig1", | ||
"properties": { | ||
"privateIPAllocationMethod": "Dynamic", | ||
"publicIPAddress": { | ||
"id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName'))]" | ||
}, | ||
"subnet": { | ||
"id": "[variables('subnetRef')]" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"apiVersion": "[variables('api-version')]", | ||
"type": "Microsoft.Compute/virtualMachines", | ||
"name": "[parameters('vmName')]", | ||
"location": "[parameters('location')]", | ||
"tags": { | ||
"displayName": "VirtualMachine" | ||
}, | ||
"dependsOn": [ | ||
"[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]" | ||
], | ||
"properties": { | ||
"hardwareProfile": { | ||
"vmSize": "[parameters('vmSize')]" | ||
}, | ||
"storageProfile": { | ||
"osDisk": { | ||
"name": "[concat(parameters('vmName'))]", | ||
"osType": "[parameters('osType')]", | ||
"caching": "ReadWrite", | ||
"vhd": { | ||
"uri": "[parameters('osDiskVhdUri')]" | ||
}, | ||
"createOption": "Attach" | ||
} | ||
}, | ||
"networkProfile": { | ||
"networkInterfaces": [ | ||
{ | ||
"id": "[resourceId('Microsoft.Network/networkInterfaces',variables('nicName'))]" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
} |
36 changes: 36 additions & 0 deletions
36
201-specialized-vm-in-existing-vnet/azuredeploy.parameters.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
|
||
"location": { | ||
"value": "West US" | ||
}, | ||
"dnsNameForPublicIP": { | ||
"value": "youruniquename" | ||
}, | ||
"existingVirtualNetworkName": { | ||
"value": "yourvnet" | ||
}, | ||
"existingVirtualNetworkResourceGroup": { | ||
"value": "VNETresourceGroup" | ||
}, | ||
"subnetName": { | ||
"value": "VNETsubnetName" | ||
}, | ||
|
||
"osDiskVhdUri": { | ||
"value": "customvhdlocation" | ||
}, | ||
"vmName": { | ||
"value": "NameOfVM" | ||
}, | ||
|
||
"osType": { | ||
"value": "Windows" | ||
}, | ||
"vmSize": { | ||
"value": "Standard_DS1" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"itemDisplayName": "Create a VM from a custom VHD and connect it to an existing VNET", | ||
"description": "This template creates a VM from a specialized VHD and let you connect it to an existing VNET that can reside in another Resource Group then the virtual machine", | ||
"summary": "Create a VM from a specialized VHD and connect it to an existing virtual network", | ||
"githubUsername": "bjoervik", | ||
"dateUpdated": "2015-10-13" | ||
} |