{
    "id": "347ab4ee-55d4-4257-b843-1ebd754fe83f",
    "name": "Deploy Complex Virtual Machines",
    "slug": "deploy-complex-virtual-machines",
    "status": "published",
    "lab_type": "pta",
    "is_sample": false,
    "duration_in_seconds": 1800,
    "metadata": {
        "courses": [
            "1a20bc1a-9d44-4503-95f2-3de135097a2e",
            "0fafa2f2-99f0-42eb-98ff-a5f046da20e1"
        ],
        "pta_sdn": "142",
        "pta_namespace": "my.ine",
        "learning_paths": [],
        "has_published_parent": true
    },
    "session": null,
    "company": "a491bc32-c056-4946-9169-cc053387bada",
    "created": "2022-08-18T20:48:12.737079Z",
    "modified": "2023-10-03T18:58:34.918807Z",
    "is_beta": false,
    "lab_objectives": [],
    "main_learning_area": "d3f82c70-f4e7-428e-afd7-4b1d28988e18",
    "learning_areas": [
        {
            "id": "d3f82c70-f4e7-428e-afd7-4b1d28988e18",
            "name": "Cloud",
            "slug": "cloud"
        }
    ],
    "categories": [],
    "tags": [],
    "difficulty": null,
    "is_web_access": true,
    "is_lab_experience": false,
    "is_featured": false,
    "cve": null,
    "severity": null,
    "year": null,
    "classification": null,
    "is_trackable": false,
    "cpe_credits": null,
    "is_skill_check": false,
    "external_url": "",
    "solution_video": null,
    "explanation_video": null,
    "description": "# Deploy Complex Virtual Machines\n\n**Objective** : Deploy Complex Virtual Machines",
    "description_html": "<h1>Deploy Complex Virtual Machines</h1>\n<p><strong>Objective</strong> : Deploy Complex Virtual Machines</p>",
    "tasks": "",
    "tasks_html": "",
    "published_date": "2020-04-07T18:00:00Z",
    "solutions": "# Solution\n\n## Create a virtual machine using Azure PowerShell with two network interfaces and multiple virtual hard disks\n\n\n**Step 1:** Start the lab, agree after reading terms and conditions and check the credential/URL provided on the page.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/1.png)\n\n\n**Step 2:** Open the Login URL link in incognito (Right click on the URL and select Open link in incognito Window option).\n\nThe URL will take you to the Azure Portal login page. Use the provided username and password to login into it.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/2_1.png)\n\nEnter password \n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/2_2.png)\n\n**Step 3:** An empty resource group  will be visible. Open Azure Powershell/Azure Bash Terminal to create a Virtual Machine. Login to your account to  account using azure command. As shown in the figure. And Hit **Run**\n\n````\nConnect-AzAccount\n````\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/3.png)\n\n**Step 4:** Create a subnet using **New-AzVirtualNetworkSubnetConfig** Azure command as given below\n\n````\n$subnetConfig = New-AzVirtualNetworkSubnetConfig -Name default -AddressPrefix 10.0.0.0/24\n````\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/4.png)\n\nCreate a Virtual Network using the subnet created in above step and **New-AzVirtualNetwork** azure command\n\n````\n$vnet = New-AzVirtualNetwork -ResourceGroupName <Resource-group-name> -Location <Location-name> -Name `\n <virtual-network-name> -AddressPrefix 10.0.0.0/16 -Subnet $subnetConfig\n````\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/5.png)\n\nCreate another subnet in the same Virtual Network using **Add-AzVirtualNetworkSubnetConfig** Azure command\n\n````\n $vnet = Add-AzVirtualNetworkSubnetConfig -Name <subnet-name> -VirtualNetwork $vnet `\n  -AddressPrefix 10.0.1.0/24\n````\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/6.png)\n\nSet the current Network in a variable using Azure **Set-AzVirtualNetwork** command\n\n```\n $vnet = Set-AzVirtualNetwork -VirtualNetwork $vnet\n```\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/7.png)\n\n**Step 5:** Create a public IP using Azure **New-AzPublicIpAddress** command \n\n```\n $pip = New-AzPublicIpAddress -ResourceGroupName <Resource-Group-Name> -Location <Location-name> `\n  -Name <IP name> -Sku Basic\n```\n**Note** When prompted for **Allocation Method** ,enter **dynamic**\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/8.png)\n\nCreate 2 Network Interfaces, using Azure **New-AzNetworkInterface** Command. Associate one of them with the Public IP created above (in Step 5)\n\n````\n$nic0 = New-AzNetworkInterface -Name advvm-nic1 -ResourceGroupName <Resource-group-name> `\n-Location <Location-name> -SubnetId $vnet.Subnets[0].Id -PublicIpAddressId $pip.Id\n$nic1 = New-AzNetworkInterface -Name advvm-nic2 -ResourceGroupName <Resource-group-name> `\n-Location <Location-name> -SubnetId $vnet.Subnets[1].Id \n````\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/9.png)\n\nEnter the Credentials for Administrative account using Azure **Get-Credential** Command\n\n```\n$cred =  Get-Credential\n```\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/10.png)\n\nFollowing window will prompt to fetch Credentials. Then Click **OK**\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/11.png)\n\n**Step 6:** Configure a Virtual Machine using the following Azure Command \n\n````\n$vmConfig = New-AzVMConfig -VMName <VirtualMachine-name> -VMSize Standard_D2s_v4 | `\nSet-AzVMOperatingSystem -Windows -ComputerName <VirtualMachine-name> -Credential $cred | `\nSet-AzVMSourceImage -PublisherName MicrosoftWindowsServer -Offer WindowsServer `\n-Skus 2016-Datacenter -Version latest | `\nAdd-AzVMNetworkInterface -Id $nic0.Id -Primary | `\nAdd-AzVMNetworkInterface -Id $nic1.Id \n````\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/12.png)\n\nDeploy the Virtual Machine as given below\n\n````\nNew-AZVm -ResourceGroupName <resource-group-name> -Location <location-name> -VM $vmConfig\n````\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/13.png)\n\n**Step 7:** Navigate to Azure Portal to check your deployed Resources\n\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/14.png)\n\nNavigate to your Virtual Machine. Click on **Disk** on the left Side\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/15.png)\n\nCreate a New Disk in the Virtual Machine\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/16.png)\n\nIn Host-Caching, Select **Read-Only**. Click on **Save**\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/17.png)\n\nConnect to your Virtual Machine. Click on **RDP** . An RDP file will be downloaded for connection. Run the file, Click **Connect**\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/18.png)\n\nEnter Aministrative Credentials and Click **Connect**\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/20.png)\n\nYou will be connected to your virtual Machine\n\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/19.png)\n\n**Step 8:** In Server Manager, Navigate to **Disk** under **Volume**. Create a New Volume with the Disk Created(in Step 7). The following window will be visible\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/21.png)\n\nCheck the Storage Capacity. Click on **Next**\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/22.png)\n\nAssign an alphabet and Click on **Next**\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/23.png)\n\nRename the volume and Click on **Next**\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/24.png)\n\nVerify the Details and Click on **Create**\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/25.png)\n\nAdditional Volume will be created\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/26.png)\n\nFor more then 2 Disks, you can create Storage Pool and configure Virtual Disk before creating a new Volume\n\n**Step 9:** Delete the resources using Delete option\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/27.png)\n\n# Conclusion \n\nIn this way you can Create a virtual machine using Azure PowerShell with two network interfaces and multiple virtual hard disks",
    "solutions_html": "<h1>Solution</h1>\n<h2>Create a virtual machine using Azure PowerShell with two network interfaces and multiple virtual hard disks</h2>\n<p><strong>Step 1:</strong> Start the lab, agree after reading terms and conditions and check the credential/URL provided on the page.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/1.png\" /></p>\n<p><strong>Step 2:</strong> Open the Login URL link in incognito (Right click on the URL and select Open link in incognito Window option).</p>\n<p>The URL will take you to the Azure Portal login page. Use the provided username and password to login into it.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/2_1.png\" /></p>\n<p>Enter password </p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/2_2.png\" /></p>\n<p><strong>Step 3:</strong> An empty resource group  will be visible. Open Azure Powershell/Azure Bash Terminal to create a Virtual Machine. Login to your account to  account using azure command. As shown in the figure. And Hit <strong>Run</strong></p>\n<p><pre class=\"codehilite\"><code>Connect-AzAccount</code></pre>\n<img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/3.png\" /></p>\n<p><strong>Step 4:</strong> Create a subnet using <strong>New-AzVirtualNetworkSubnetConfig</strong> Azure command as given below</p>\n<pre class=\"codehilite\"><code>$subnetConfig = New-AzVirtualNetworkSubnetConfig -Name default -AddressPrefix 10.0.0.0/24</code></pre>\n\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/4.png\" /></p>\n<p>Create a Virtual Network using the subnet created in above step and <strong>New-AzVirtualNetwork</strong> azure command</p>\n<pre class=\"codehilite\"><code>$vnet = New-AzVirtualNetwork -ResourceGroupName &lt;Resource-group-name&gt; -Location &lt;Location-name&gt; -Name `\n &lt;virtual-network-name&gt; -AddressPrefix 10.0.0.0/16 -Subnet $subnetConfig</code></pre>\n\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/5.png\" /></p>\n<p>Create another subnet in the same Virtual Network using <strong>Add-AzVirtualNetworkSubnetConfig</strong> Azure command</p>\n<pre class=\"codehilite\"><code> $vnet = Add-AzVirtualNetworkSubnetConfig -Name &lt;subnet-name&gt; -VirtualNetwork $vnet `\n  -AddressPrefix 10.0.1.0/24</code></pre>\n\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/6.png\" /></p>\n<p>Set the current Network in a variable using Azure <strong>Set-AzVirtualNetwork</strong> command</p>\n<pre class=\"codehilite\"><code> $vnet = Set-AzVirtualNetwork -VirtualNetwork $vnet</code></pre>\n\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/7.png\" /></p>\n<p><strong>Step 5:</strong> Create a public IP using Azure <strong>New-AzPublicIpAddress</strong> command </p>\n<p><pre class=\"codehilite\"><code> $pip = New-AzPublicIpAddress -ResourceGroupName &lt;Resource-Group-Name&gt; -Location &lt;Location-name&gt; `\n  -Name &lt;IP name&gt; -Sku Basic</code></pre>\n<strong>Note</strong> When prompted for <strong>Allocation Method</strong> ,enter <strong>dynamic</strong></p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/8.png\" /></p>\n<p>Create 2 Network Interfaces, using Azure <strong>New-AzNetworkInterface</strong> Command. Associate one of them with the Public IP created above (in Step 5)</p>\n<pre class=\"codehilite\"><code>$nic0 = New-AzNetworkInterface -Name advvm-nic1 -ResourceGroupName &lt;Resource-group-name&gt; `\n-Location &lt;Location-name&gt; -SubnetId $vnet.Subnets[0].Id -PublicIpAddressId $pip.Id\n$nic1 = New-AzNetworkInterface -Name advvm-nic2 -ResourceGroupName &lt;Resource-group-name&gt; `\n-Location &lt;Location-name&gt; -SubnetId $vnet.Subnets[1].Id </code></pre>\n\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/9.png\" /></p>\n<p>Enter the Credentials for Administrative account using Azure <strong>Get-Credential</strong> Command</p>\n<pre class=\"codehilite\"><code>$cred =  Get-Credential</code></pre>\n\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/10.png\" /></p>\n<p>Following window will prompt to fetch Credentials. Then Click <strong>OK</strong></p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/11.png\" /></p>\n<p><strong>Step 6:</strong> Configure a Virtual Machine using the following Azure Command </p>\n<pre class=\"codehilite\"><code>$vmConfig = New-AzVMConfig -VMName &lt;VirtualMachine-name&gt; -VMSize Standard_D2s_v4 | `\nSet-AzVMOperatingSystem -Windows -ComputerName &lt;VirtualMachine-name&gt; -Credential $cred | `\nSet-AzVMSourceImage -PublisherName MicrosoftWindowsServer -Offer WindowsServer `\n-Skus 2016-Datacenter -Version latest | `\nAdd-AzVMNetworkInterface -Id $nic0.Id -Primary | `\nAdd-AzVMNetworkInterface -Id $nic1.Id </code></pre>\n\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/12.png\" /></p>\n<p>Deploy the Virtual Machine as given below</p>\n<pre class=\"codehilite\"><code>New-AZVm -ResourceGroupName &lt;resource-group-name&gt; -Location &lt;location-name&gt; -VM $vmConfig</code></pre>\n\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/13.png\" /></p>\n<p><strong>Step 7:</strong> Navigate to Azure Portal to check your deployed Resources</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/14.png\" /></p>\n<p>Navigate to your Virtual Machine. Click on <strong>Disk</strong> on the left Side</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/15.png\" /></p>\n<p>Create a New Disk in the Virtual Machine</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/16.png\" /></p>\n<p>In Host-Caching, Select <strong>Read-Only</strong>. Click on <strong>Save</strong></p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/17.png\" /></p>\n<p>Connect to your Virtual Machine. Click on <strong>RDP</strong> . An RDP file will be downloaded for connection. Run the file, Click <strong>Connect</strong></p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/18.png\" /></p>\n<p>Enter Aministrative Credentials and Click <strong>Connect</strong></p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/20.png\" /></p>\n<p>You will be connected to your virtual Machine</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/19.png\" /></p>\n<p><strong>Step 8:</strong> In Server Manager, Navigate to <strong>Disk</strong> under <strong>Volume</strong>. Create a New Volume with the Disk Created(in Step 7). The following window will be visible</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/21.png\" /></p>\n<p>Check the Storage Capacity. Click on <strong>Next</strong></p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/22.png\" /></p>\n<p>Assign an alphabet and Click on <strong>Next</strong></p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/23.png\" /></p>\n<p>Rename the volume and Click on <strong>Next</strong></p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/24.png\" /></p>\n<p>Verify the Details and Click on <strong>Create</strong></p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/25.png\" /></p>\n<p>Additional Volume will be created</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/26.png\" /></p>\n<p>For more then 2 Disks, you can create Storage Pool and configure Virtual Disk before creating a new Volume</p>\n<p><strong>Step 9:</strong> Delete the resources using Delete option</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-complex-virtual-machines/27.png\" /></p>\n<h1>Conclusion</h1>\n<p>In this way you can Create a virtual machine using Azure PowerShell with two network interfaces and multiple virtual hard disks</p>",
    "flags": [],
    "min_points_to_pass": null,
    "access_type": "web",
    "user_status": "unstarted",
    "user_lab_status": null,
    "user_status_modified": null,
    "user_flags": [],
    "global_running_session": null
}