SlideShare a Scribd company logo
1 of 15
Download to read offline
Creating a Wanos VM on Azure
Prepared for
Creating a Wanos VM on Azure
Page 2 of 15
TABLE OF CONTENTS
1. Introduction....................................................................................................................................................3
2. Windows Powershell ......................................................................................................................................3
3. Wanos VM Install Step-By-Step......................................................................................................................3
3.1. Logging in to Azure Resource Manager ................................................................................................3
3.2. Setting Global Variables ........................................................................................................................5
3.3. Create a new Resource Group ..............................................................................................................6
3.4. Create and Configure a new Virtual Network .......................................................................................7
3.5. Create and Configure a Virtual Network Interface ...............................................................................8
3.6. Create and Configure a Network Security Group..................................................................................9
3.7. Create Network Security Group Access Rules.....................................................................................10
3.8. Create Storage Account and Storage Container .................................................................................10
3.9. Copy Wanos VHD to Local Storage Container.....................................................................................11
3.10. Create Wanos Virtual Machine ...........................................................................................................12
4. Full Script ......................................................................................................................................................13
Creating a Wanos VM on Azure
Page 3 of 15
1. INTRODUCTION
This document details the steps that need to be taken to get a Wanos Virtual Machine (VM) up and running on
Microsoft Azure.
Azure has two deployment models, Azure Service Manager (ASM) and Azure Resource Manager (ARM). This
guide uses the ARM deployment model which is the preferred deployment model as communicated by
Microsoft. More information on the details of each model can be found here: https://docs.microsoft.com/en-
us/azure/azure-resource-manager/resource-manager-deployment-model
2. WINDOWS POWERSHELL
The Wanos VM is deployed using Windows PowerShell.
To install PowerShell please visit this link and follow the steps provided: https://docs.microsoft.com/en-
us/powershell/scripting/setup/installing-windows-powershell?view=powershell-5.1. Please ensure you have
the latest version of PowerShell installed.
You will also need to have the AzureRM Module installed. To check if this is included with your version of
PowerShell please run the following command: Get-Module -ListAvailable AzureRM
If you do not have the AzureRM Module installed or if the module is a version earlier than 3.6. then please go
to this link and follow the instructions: https://docs.microsoft.com/en-us/powershell/azure/install-azurerm-
ps?view=azurermps-4.3.1
You can also use the Azure Portal (https://portal.azure.com) to configure many of the settings that the
PowerShell steps in this document take. This document only details the PowerShell steps needed to get your
Wanos VM up and running.
3. WANOS VM INSTALL STEP-BY-STEP
3.1. Logging in to Azure Resource Manager
To login to Azure Resource Manager run the following at Azure PowerShell prompt: Login-AzureRmAccount
You will be presented with a web login box. Enter your Azure Subscription Account details and the password
when prompted to do so as shown in the images below.
Creating a Wanos VM on Azure
Page 4 of 15
Once you have logged in successfully you will be provided with the details of the subscription as shown in the
image below.
If your Azure account has access to multiple subscriptions you need to select which subscription you are going
to deploy Wanos to. To get a list of subscriptions run the following command: Get-AzureRmSubscription
Then run: Select-AzureRmSubscription -SubscriptionName <Subscription Name>. In the example
below the subscription name is chrislazari.
Creating a Wanos VM on Azure
Page 5 of 15
3.2. Setting Global Variables
The script that creates the Wanos VM for you uses many variables that need to be set before you start running
the necessary cmdlets. Below is the list of variables and details about each one.
 $subscriptionName = "chrislazari" – Must change to your subscription name. In this example,
it is chrislazari
 $resourceGroupName = "Wanos" – This is the resource group that will be created and will house all
the necessary resources for Wanos. If you have no resource group named Wanos, then it is
recommended you use the default set in this example.
 $locationName = "westeurope" – This variable sets the Azure Data Center location where you
Wanos resources will be hosted. In this example, we are using the West Europe Data Center. To see a
list of Azure Data Centers run the following PowerShell command: Get-AzureLocation or visit this
link: https://azure.microsoft.com/en-us/overview/datacenters/how-to-choose/
 $virtualNetworkName = "Wanos_Network" – This variable sets the network name which your VM
will be running on. You can leave it as shown or change it.
 $virtualNetworkSubnetName = "Subnet1" – This variable sets the subnet name on the virtual
network you will be creating. You can leave it as shown or change it.
 $virtualPublicIpName = "Wanos_Public_IP" – This variable sets the name for the Public IP
resource as it will be displayed on the Resource Manager. You can leave it as shown or change it.
 $virtualNICName = "WanosNIC01" – This variable sets the name for the Virtual Network Interface
Card resource as it will be displayed on the Resource Manager. You can leave it as shown or change it.
 $networkSecurityGroupName = "Wanos_NSG" – This variable sets the name for the Network
Security Group that will be created. You can leave it as shown or change it.
 $virtualMachineName = "Wanos_VM" – This variable sets the name of your Wanos virtual
machine. You can leave it as shown or change it.
 $virtualMachineSize = "Basic_A2" – This variable sets the size of the VM that will be running
Wanos. The current setting of “Basic_A2’ has sufficient resources that meet the minimum required
specification. For a list of possible Azure virtual machine sizes run the command Get-AzureRmVMSize
$locationName | Out-GridView after setting the $locationName variable.
 $virtualMachineOSDiskName = "Wanos_OS" – This variable sets the name of your Wanos virtual
machine Disk. You can leave it as shown or change it.
Creating a Wanos VM on Azure
Page 6 of 15
 $storageAccountName = "wanostest" – Set this variable to your storage account or alternative
set the storage account name that will be created in section 3.8. This will be to house the Wanos
Virtual Hard Disk (VHD). Note that every storage account name on Azure must be unique so if a name
that you have chosen has been taken you will need to change this variable. All storage names must be
in lower case and can only consist of letters and numbers. In this example, we are using wanostest.
 $storageSKUName = "Standard_GRS" – This variable sets the SKU of the storage account i.e. the
necessary redundancy and associated cost. You can find a list of possible SKU’s on this webpage:
https://docs.microsoft.com/en-us/powershell/module/azurerm.storage/new-
azurermstorageaccount?view=azurermps-4.3.1. In this example, we are using Standard_GRS which is
Geo-redundant storage.
 $storageContainerName = "vhd" – This variable sets the name for the storage container within
the storage account hosting the Wanos VHD. You can leave it as shown or change it.
 $sourceVHD = “https://wanosds.blob.core.windows.net/vhd/wanos-3.2.3-ub.vhd” -
This variable sets the location of the source VHD. This variable must be set as shown here.
 $destinationBLOB = "wanos.vhd" – This variable sets the name of the Wanos VHD once it is
copied to your storage container. You can leave it as shown or change it.
 $destinationvhd ="https://wanostest.blob.core.windows.net/vhd/wanos.vhd" – This
variable sets the VHD location the VM will use once its configured. It must be set as is. You must
ensure you change the text in red to your storage account name or create a new one in section 3.8. In
this example, it is wanostest.
Run each command to ensure your variables are all set for the scripts as shown in the image below.
3.3. Create a new Resource Group
The first step in creating the Wanos VM is to create a Resource Groupon Azure which will house all the
resources needed for the Wanos VM.
To create a new Resource Group run the following command:
 New-AzureRmResourceGroup -Location $locationName -Name $resourceGroupName
Creating a Wanos VM on Azure
Page 7 of 15
3.4. Create and Configure a new Virtual Network
The Wanos VM requires a virtual network to host it on Azure. Run the following commands to create and
configure the Virtual Network.
 New-AzureRmVirtualNetwork -ResourceGroupName $resourceGroupName -Name
$virtualNetworkName -AddressPrefix 10.101.0.0/16 -Location $locationName
 $vnet = Get-AzureRmVirtualNetwork -ResourceGroupName $resourceGroupName -Name
$virtualNetworkName
 Add-AzureRmVirtualNetworkSubnetConfig -Name $virtualNetworkSubnetName -
VirtualNetwork $vnet -AddressPrefix 10.101.1.0/24
 Set-AzureRmVirtualNetwork -VirtualNetwork $vnet

Creating a Wanos VM on Azure
Page 8 of 15
3.5. Create and Configure a Virtual Network Interface
The Wanos VM requires a virtual network interface to connect to the virtual network created in the previous
step. Run the following commands to create and configure the Virtual Network Interface.
 $virtualNetwork = Get-AzureRmVirtualNetwork -ResourceGroupName
$resourceGroupName -Name $virtualNetworkName
 $publicIp = New-AzureRmPublicIpAddress -Name $virtualPublicIpName -
ResourceGroupName $ResourceGroupName -Location $locationName -AllocationMethod
Dynamic
Creating a Wanos VM on Azure
Page 9 of 15
 $networkInterface = New-AzureRmNetworkInterface -ResourceGroupName
$resourceGroupName -Name $virtualNICName -Location $locationName -SubnetId
$virtualNetwork.Subnets[0].Id -PublicIpAddressId $publicIp.Id
3.6. Create and Configure a Network Security Group
The next step is to create and configure a Network Security Group (NSG) and bind it to the virtual NIC created
in the previous step. The NSG manages access to and from your Wanos VM. To create a Network Security
Group and bind it to the virtual NIC run the following commands:
 $nsg = New-AzureRmNetworkSecurityGroup -ResourceGroupName $ResourceGroupName -
Location $locationName -Name $networkSecurityGroupName
 $nic = Get-AzureRmNetworkInterface -ResourceGroupName $ResourceGroupName -Name
$virtualNICName
 $nic.NetworkSecurityGroup = $nsg
 Set-AzureRmNetworkInterface -NetworkInterface $nic
Creating a Wanos VM on Azure
Page 10 of 15
3.7. Create Network Security Group Access Rules
Now that the NSG has been created we need to configure access rules to allow traffic inbound to the Wanos
VM. Wanos requires SSH access as well as HTTPS access. To configure these rules run the following commands.
 Get-AzureRmNetworkSecurityGroup -ResourceGroupName $ResourceGroupName | Add-
AzureRmNetworkSecurityRuleConfig -Name tunnel-rule -Description "Allow UDP
4050" -Access Allow -Protocol Udp -Direction Inbound -Priority 100 -
SourceAddressPrefix Internet -SourcePortRange * -DestinationAddressPrefix * -
DestinationPortRange 4050 | Set-AzureRmNetworkSecurityGroup
 Get-AzureRmNetworkSecurityGroup -ResourceGroupName $ResourceGroupName | Add-
AzureRmNetworkSecurityRuleConfig -Name ssh-rule -Description "Allow SSH" -
Access Allow -Protocol Tcp -Direction Inbound -Priority 101 -
SourceAddressPrefix Internet -SourcePortRange * -DestinationAddressPrefix * -
DestinationPortRange 22 | Set-AzureRmNetworkSecurityGroup
 Get-AzureRmNetworkSecurityGroup -ResourceGroupName $ResourceGroupName | Add-
AzureRmNetworkSecurityRuleConfig -Name https-rule -Description "Allow HTTPS" -
Access Allow -Protocol Tcp -Direction Inbound -Priority 102 -
SourceAddressPrefix Internet -SourcePortRange * -DestinationAddressPrefix * -
DestinationPortRange 443 | Set-AzureRmNetworkSecurityGroup
3.8. Create Storage Account and Storage Container
Now that the network configuration is complete we need to configure the storage that will house the Wanos
VHD. First, we need a Storage Account and within that Storage Account we need a Storage Container. To
create these run the following commands.
 New-AzureRmStorageAccount -ResourceGroupName $ResourceGroupName -AccountName
$storageAccountName -Location $locationName -SkuName $storageSKUName
Creating a Wanos VM on Azure
Page 11 of 15
 $keys = Get-AzureRmStorageAccountKey -ResourceGroupName $ResourceGroupName -
Name $storageAccountName
 $storageContext = New-AzureStorageContext -StorageAccountName
$storageAccountName -StorageAccountKey $keys[0].Value
 New-AzureStorageContainer -Context $storageContext -Name $storageContainerName
3.9. Copy Wanos VHD to Local Storage Container
Now that the storage has been created we can copy the Wanos VHD from its source. To do this run the
following commands.
 $keys = Get-AzureRmStorageAccountKey -ResourceGroupName $ResourceGroupName -
Name $storageAccountName
 $storageContext = New-AzureStorageContext -StorageAccountName
$storageAccountName -StorageAccountKey $keys[0].Value
 $blob1 = Start-AzureStorageBlobCopy -srcUri $sourceVHD -DestContainer
$storageContainerName -DestBlob $destinationBLOB -DestContext $storageContext
Creating a Wanos VM on Azure
Page 12 of 15
3.10. Create Wanos Virtual Machine
Everything is now in place to create the Wanos VM and get it up and running. To do this run the following
commands.
 $vmConfig = New-AzureRmVMConfig -VMName $virtualMachineName -VMSize
$virtualMachineSize
 $vmConfig = Set-AzureRmVMOSDisk -VM $vmConfig -Name $virtualMachineOSDiskName -
VhdUri $destinationVhd -CreateOption Attach -Linux
 $vmConfig = Add-AzureRmVMNetworkInterface -VM $vmConfig -Id
$networkInterface.Id
 $vm = New-AzureRmVM -VM $vmConfig -Location $locationName -ResourceGroupName
$resourceGroupName
The process is now complete. To check that everything is in place got to the Azure Portal
(https://portal.azure.com) and open up the Resource Group you created. You should see all the resources
listed there as per the image below.
To login to your VM open the VM Overview by clicking on the VM icon in the image above. Make a note of the
Public IP Address as shown in the image below and then use your favourite SSH client to login to the VM.
Creating a Wanos VM on Azure
Page 13 of 15
The username is tc and the password is ChangeM3
4. FULL SCRIPT
For ease of use here is the full script with comments.
# Login to Azure Resource Manager
Login-AzureRmAccount
# Select the Azure Subscription where you want to deploy Wanos to
Select-AzureRmSubscription -SubscriptionName chrislazari
# Set your global variables
$subscriptionName = "chrislazari" # Enter your subscription name here
$resourceGroupName = "Wanos" # Enter a unique resource group name or leave as wanos
$locationName = "westeurope" # Enter which Azure location you want your resources to reside in
$virtualNetworkName = "Wanos_Network" # Enter a unique network name or leave as default
$virtualNetworkSubnetName = "Subnet1" # Enter a unique subnet name or leave as default
$virtualPublicIpName = "Wanos_Public_IP" # Enter a descriptive name for the Public IP Address or leave as
default
$virtualNICName = "WanosNIC01" # Enter a descriptive name for the Virtual Network Interface Card or leave
as default
$networkSecurityGroupName = "Wanos_NSG" # Enter a descriptive name for the Network Security Group or
leave as default
$virtualMachineName = "Wanos_VM" # Enter a descriptive name for the Virtual Machine or leave as default
$virtualMachineSize = "Basic_A2" # Enter an Azure VM Size. The current setting is the minimum requirement
for Wanos
$virtualMachineOSDiskName = "Wanos_OS" # Enter a descriptive name for the VM OS Disk or leave as default
$storageAccountName = "wanostest" # Enter a descriptive Storage Account Name or leave as default
$storageSKUName = "Standard_GRS" # Leave as default
$storageContainerName = "vhd" # Leave as default
$sourceVHD = "https://wanosds.blob.core.windows.net/vhd/wanos-3.2.3-ub.vhd" # Leave as default
$destinationBLOB = "wanos.vhd" # Leave as default
$destinationvhd ="https://wanostest.blob.core.windows.net/vhd/wanos.vhd" # Leave as default
# Create a new Resource Group
Creating a Wanos VM on Azure
Page 14 of 15
New-AzureRmResourceGroup -Location $locationName -Name $resourceGroupName
# Create and Configure a new Virtual Network
New-AzureRmVirtualNetwork -ResourceGroupName $resourceGroupName -Name $virtualNetworkName -
AddressPrefix 10.101.0.0/16 -Location $locationName
$vnet = Get-AzureRmVirtualNetwork -ResourceGroupName $resourceGroupName -Name
$virtualNetworkName
Add-AzureRmVirtualNetworkSubnetConfig -Name $virtualNetworkSubnetName -VirtualNetwork $vnet -
AddressPrefix 10.101.1.0/24
Set-AzureRmVirtualNetwork -VirtualNetwork $vnet
# Create and Configure a Virtual Network Interface
$virtualNetwork = Get-AzureRmVirtualNetwork -ResourceGroupName $resourceGroupName -Name
$virtualNetworkName
$publicIp = New-AzureRmPublicIpAddress -Name $virtualPublicIpName -ResourceGroupName
$ResourceGroupName -Location $locationName -AllocationMethod Dynamic
$networkInterface = New-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName -Name
$virtualNICName -Location $locationName -SubnetId $virtualNetwork.Subnets[0].Id -PublicIpAddressId
$publicIp.Id
# Create and Configure a Network Security Group and bind it to the Virtual NIC
$nsg = New-AzureRmNetworkSecurityGroup -ResourceGroupName $ResourceGroupName -Location
$locationName -Name $networkSecurityGroupName
$nic = Get-AzureRmNetworkInterface -ResourceGroupName $ResourceGroupName -Name $virtualNICName
$nic.NetworkSecurityGroup = $nsg
Set-AzureRmNetworkInterface -NetworkInterface $nic
# Create and add SSH and HTTP Rules to Network Security Group
Get-AzureRmNetworkSecurityGroup -ResourceGroupName $ResourceGroupName | Add-
AzureRmNetworkSecurityRuleConfig -Name ssh-rule -Description "Allow SSH" -Access Allow -Protocol Tcp -
Direction Inbound -Priority 100 -SourceAddressPrefix Internet -SourcePortRange * -DestinationAddressPrefix *
-DestinationPortRange 22 | Set-AzureRmNetworkSecurityGroup
Get-AzureRmNetworkSecurityGroup -ResourceGroupName $ResourceGroupName | Add-
AzureRmNetworkSecurityRuleConfig -Name web-rule -Description "Allow HTTP" -Access Allow -Protocol Tcp -
Direction Inbound -Priority 101 -SourceAddressPrefix Internet -SourcePortRange * -DestinationAddressPrefix *
-DestinationPortRange 80 | Set-AzureRmNetworkSecurityGroup
# Create Storage Account and Storage Container for Wanos VHD
New-AzureRmStorageAccount -ResourceGroupName $ResourceGroupName -AccountName
$storageAccountName -Location $locationName -SkuName $storageSKUName
$keys = Get-AzureRmStorageAccountKey -ResourceGroupName $ResourceGroupName -Name
$storageAccountName
$storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -
StorageAccountKey $keys[0].Value
New-AzureStorageContainer -Context $storageContext -Name $storageContainerName
# Copy Wanos VHD to Local Storage Container
Creating a Wanos VM on Azure
Page 15 of 15
$keys = Get-AzureRmStorageAccountKey -ResourceGroupName $ResourceGroupName -Name
$storageAccountName
$storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -
StorageAccountKey $keys[0].Value
$blob1 = Start-AzureStorageBlobCopy -srcUri $sourceVHD -DestContainer $storageContainerName -DestBlob
$destinationBLOB -DestContext $storageContext
#Sleep for 5 minutes to ensure copy is completed before starting VM creation
Start-Sleep -s 300
# Create and Configure Virtual Machine
$vmConfig = New-AzureRmVMConfig -VMName $virtualMachineName -VMSize $virtualMachineSize
$vmConfig = Set-AzureRmVMOSDisk -VM $vmConfig -Name $virtualMachineOSDiskName -VhdUri
$destinationVhd -CreateOption Attach -Linux
$vmConfig = Add-AzureRmVMNetworkInterface -VM $vmConfig -Id $networkInterface.Id
$vm = New-AzureRmVM -VM $vmConfig -Location $locationName -ResourceGroupName
$resourceGroupName

More Related Content

What's hot

Www.vmware.com support developer_windowstoolkit_wintk10_doc_viwin_admin
Www.vmware.com support developer_windowstoolkit_wintk10_doc_viwin_adminWww.vmware.com support developer_windowstoolkit_wintk10_doc_viwin_admin
Www.vmware.com support developer_windowstoolkit_wintk10_doc_viwin_adminVenkata Ramana
 
Slides Cassandra
Slides CassandraSlides Cassandra
Slides Cassandrahamidd77
 
MySQL's new Secure by Default Install -- All Things Open October 20th 2015
MySQL's new Secure by Default Install -- All Things Open October 20th 2015MySQL's new Secure by Default Install -- All Things Open October 20th 2015
MySQL's new Secure by Default Install -- All Things Open October 20th 2015Dave Stokes
 
Pluggable database 3
Pluggable database 3Pluggable database 3
Pluggable database 3Osama Mustafa
 
Mysql reference
Mysql referenceMysql reference
Mysql referenceglmalpica
 
C fowler azure-dojo
C fowler azure-dojoC fowler azure-dojo
C fowler azure-dojosdeconf
 
Deploy agent in em12c
Deploy agent in em12cDeploy agent in em12c
Deploy agent in em12cOsama Mustafa
 
Uniface Lectures Webinar - Application & Infrastructure Security - Hardening ...
Uniface Lectures Webinar - Application & Infrastructure Security - Hardening ...Uniface Lectures Webinar - Application & Infrastructure Security - Hardening ...
Uniface Lectures Webinar - Application & Infrastructure Security - Hardening ...Uniface
 
Rhel asmlib to_udev
Rhel asmlib to_udevRhel asmlib to_udev
Rhel asmlib to_udevMohsen B
 
Backup workflow for SMHV on windows 2008R2 HYPER-V
Backup workflow for SMHV on windows 2008R2 HYPER-VBackup workflow for SMHV on windows 2008R2 HYPER-V
Backup workflow for SMHV on windows 2008R2 HYPER-VAshwin Pawar
 
Vm ware server-tips-tricks
Vm ware server-tips-tricksVm ware server-tips-tricks
Vm ware server-tips-tricksunixadminrasheed
 
setting up v ms
 setting up v ms setting up v ms
setting up v mschigio
 

What's hot (20)

FIWARE Lab Cloud Portal
FIWARE Lab Cloud PortalFIWARE Lab Cloud Portal
FIWARE Lab Cloud Portal
 
Www.vmware.com support developer_windowstoolkit_wintk10_doc_viwin_admin
Www.vmware.com support developer_windowstoolkit_wintk10_doc_viwin_adminWww.vmware.com support developer_windowstoolkit_wintk10_doc_viwin_admin
Www.vmware.com support developer_windowstoolkit_wintk10_doc_viwin_admin
 
Oracle backup
Oracle backupOracle backup
Oracle backup
 
Slides Cassandra
Slides CassandraSlides Cassandra
Slides Cassandra
 
MySQL's new Secure by Default Install -- All Things Open October 20th 2015
MySQL's new Secure by Default Install -- All Things Open October 20th 2015MySQL's new Secure by Default Install -- All Things Open October 20th 2015
MySQL's new Secure by Default Install -- All Things Open October 20th 2015
 
My sql
My sqlMy sql
My sql
 
Pluggable database 3
Pluggable database 3Pluggable database 3
Pluggable database 3
 
V mware error
V mware errorV mware error
V mware error
 
Mysql reference
Mysql referenceMysql reference
Mysql reference
 
C fowler azure-dojo
C fowler azure-dojoC fowler azure-dojo
C fowler azure-dojo
 
Deploy agent in em12c
Deploy agent in em12cDeploy agent in em12c
Deploy agent in em12c
 
Uniface Lectures Webinar - Application & Infrastructure Security - Hardening ...
Uniface Lectures Webinar - Application & Infrastructure Security - Hardening ...Uniface Lectures Webinar - Application & Infrastructure Security - Hardening ...
Uniface Lectures Webinar - Application & Infrastructure Security - Hardening ...
 
Exploring App fabric
Exploring App fabricExploring App fabric
Exploring App fabric
 
Full MSSQL Injection PWNage
Full MSSQL Injection PWNageFull MSSQL Injection PWNage
Full MSSQL Injection PWNage
 
Firebird
FirebirdFirebird
Firebird
 
Instalar PENTAHO 5 en CentOS 6
Instalar PENTAHO 5 en CentOS 6Instalar PENTAHO 5 en CentOS 6
Instalar PENTAHO 5 en CentOS 6
 
Rhel asmlib to_udev
Rhel asmlib to_udevRhel asmlib to_udev
Rhel asmlib to_udev
 
Backup workflow for SMHV on windows 2008R2 HYPER-V
Backup workflow for SMHV on windows 2008R2 HYPER-VBackup workflow for SMHV on windows 2008R2 HYPER-V
Backup workflow for SMHV on windows 2008R2 HYPER-V
 
Vm ware server-tips-tricks
Vm ware server-tips-tricksVm ware server-tips-tricks
Vm ware server-tips-tricks
 
setting up v ms
 setting up v ms setting up v ms
setting up v ms
 

Similar to Creating a wanos vm on azure

Deploying to azure web sites
Deploying to azure web sitesDeploying to azure web sites
Deploying to azure web sitesGiant Penguin
 
Software Defined Datacenter
Software Defined DatacenterSoftware Defined Datacenter
Software Defined DatacenterNETWAYS
 
How to backup and restore a vm using veeam
How to backup and restore a vm using veeamHow to backup and restore a vm using veeam
How to backup and restore a vm using veeamRicardo Montes de Oca
 
How to become cloud backup provider with Cloudian HyperStore and CloudBerry L...
How to become cloud backup provider with Cloudian HyperStore and CloudBerry L...How to become cloud backup provider with Cloudian HyperStore and CloudBerry L...
How to become cloud backup provider with Cloudian HyperStore and CloudBerry L...Cloudian
 
Zenoss core beta_installation_guide_r5.0.0b2_d99.14.253
Zenoss core beta_installation_guide_r5.0.0b2_d99.14.253Zenoss core beta_installation_guide_r5.0.0b2_d99.14.253
Zenoss core beta_installation_guide_r5.0.0b2_d99.14.253Sachin Jaypatre
 
Automated shutdown
Automated shutdownAutomated shutdown
Automated shutdownMario Berend
 
How To Set a Vagrant Development System
How To Set a Vagrant Development SystemHow To Set a Vagrant Development System
How To Set a Vagrant Development SystemPaul Bearne
 
Azure from scratch Part 1 By Girish Kalamati
Azure from scratch Part 1 By Girish KalamatiAzure from scratch Part 1 By Girish Kalamati
Azure from scratch Part 1 By Girish KalamatiGirish Kalamati
 
Salt Cloud vmware-orchestration
Salt Cloud vmware-orchestrationSalt Cloud vmware-orchestration
Salt Cloud vmware-orchestrationMo Rawi
 
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Carlos Sanchez
 
Cohesive networks Support Docs: VNS3:turret WAF Guide
Cohesive networks Support Docs: VNS3:turret WAF GuideCohesive networks Support Docs: VNS3:turret WAF Guide
Cohesive networks Support Docs: VNS3:turret WAF GuideCohesive Networks
 
SCasia 2018 MSFT hands on session for Azure Batch AI
SCasia 2018 MSFT hands on session for Azure Batch AISCasia 2018 MSFT hands on session for Azure Batch AI
SCasia 2018 MSFT hands on session for Azure Batch AIHiroshi Tanaka
 
Automating Azure VMs with PowerShell
Automating Azure VMs with PowerShellAutomating Azure VMs with PowerShell
Automating Azure VMs with PowerShellAlexander Feschenko
 
Vsphere esxi-vcenter-server-601-setup-mscs
Vsphere esxi-vcenter-server-601-setup-mscsVsphere esxi-vcenter-server-601-setup-mscs
Vsphere esxi-vcenter-server-601-setup-mscskanth2161
 
Ansible & CloudStack - Configuration Management
Ansible & CloudStack - Configuration ManagementAnsible & CloudStack - Configuration Management
Ansible & CloudStack - Configuration ManagementShapeBlue
 
Open stack and_vagrant-os-meetup-2015
Open stack and_vagrant-os-meetup-2015Open stack and_vagrant-os-meetup-2015
Open stack and_vagrant-os-meetup-2015yfauser
 

Similar to Creating a wanos vm on azure (20)

Deploying to azure web sites
Deploying to azure web sitesDeploying to azure web sites
Deploying to azure web sites
 
Software Defined Datacenter
Software Defined DatacenterSoftware Defined Datacenter
Software Defined Datacenter
 
How to backup and restore a vm using veeam
How to backup and restore a vm using veeamHow to backup and restore a vm using veeam
How to backup and restore a vm using veeam
 
Azure powershell management
Azure powershell managementAzure powershell management
Azure powershell management
 
How to become cloud backup provider with Cloudian HyperStore and CloudBerry L...
How to become cloud backup provider with Cloudian HyperStore and CloudBerry L...How to become cloud backup provider with Cloudian HyperStore and CloudBerry L...
How to become cloud backup provider with Cloudian HyperStore and CloudBerry L...
 
Zenoss core beta_installation_guide_r5.0.0b2_d99.14.253
Zenoss core beta_installation_guide_r5.0.0b2_d99.14.253Zenoss core beta_installation_guide_r5.0.0b2_d99.14.253
Zenoss core beta_installation_guide_r5.0.0b2_d99.14.253
 
Automated shutdown
Automated shutdownAutomated shutdown
Automated shutdown
 
How To Set a Vagrant Development System
How To Set a Vagrant Development SystemHow To Set a Vagrant Development System
How To Set a Vagrant Development System
 
Azure from scratch Part 1 By Girish Kalamati
Azure from scratch Part 1 By Girish KalamatiAzure from scratch Part 1 By Girish Kalamati
Azure from scratch Part 1 By Girish Kalamati
 
UK Azure Users Group
UK Azure Users Group UK Azure Users Group
UK Azure Users Group
 
Oracle autovue
Oracle autovueOracle autovue
Oracle autovue
 
Salt Cloud vmware-orchestration
Salt Cloud vmware-orchestrationSalt Cloud vmware-orchestration
Salt Cloud vmware-orchestration
 
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
 
Cohesive networks Support Docs: VNS3:turret WAF Guide
Cohesive networks Support Docs: VNS3:turret WAF GuideCohesive networks Support Docs: VNS3:turret WAF Guide
Cohesive networks Support Docs: VNS3:turret WAF Guide
 
SCasia 2018 MSFT hands on session for Azure Batch AI
SCasia 2018 MSFT hands on session for Azure Batch AISCasia 2018 MSFT hands on session for Azure Batch AI
SCasia 2018 MSFT hands on session for Azure Batch AI
 
Automating Azure VMs with PowerShell
Automating Azure VMs with PowerShellAutomating Azure VMs with PowerShell
Automating Azure VMs with PowerShell
 
Vsphere esxi-vcenter-server-601-setup-mscs
Vsphere esxi-vcenter-server-601-setup-mscsVsphere esxi-vcenter-server-601-setup-mscs
Vsphere esxi-vcenter-server-601-setup-mscs
 
Ansible & CloudStack - Configuration Management
Ansible & CloudStack - Configuration ManagementAnsible & CloudStack - Configuration Management
Ansible & CloudStack - Configuration Management
 
Open stack and_vagrant-os-meetup-2015
Open stack and_vagrant-os-meetup-2015Open stack and_vagrant-os-meetup-2015
Open stack and_vagrant-os-meetup-2015
 
AWS essentials EC2
AWS essentials EC2AWS essentials EC2
AWS essentials EC2
 

Recently uploaded

Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 

Recently uploaded (20)

Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

Creating a wanos vm on azure

  • 1. Creating a Wanos VM on Azure Prepared for
  • 2. Creating a Wanos VM on Azure Page 2 of 15 TABLE OF CONTENTS 1. Introduction....................................................................................................................................................3 2. Windows Powershell ......................................................................................................................................3 3. Wanos VM Install Step-By-Step......................................................................................................................3 3.1. Logging in to Azure Resource Manager ................................................................................................3 3.2. Setting Global Variables ........................................................................................................................5 3.3. Create a new Resource Group ..............................................................................................................6 3.4. Create and Configure a new Virtual Network .......................................................................................7 3.5. Create and Configure a Virtual Network Interface ...............................................................................8 3.6. Create and Configure a Network Security Group..................................................................................9 3.7. Create Network Security Group Access Rules.....................................................................................10 3.8. Create Storage Account and Storage Container .................................................................................10 3.9. Copy Wanos VHD to Local Storage Container.....................................................................................11 3.10. Create Wanos Virtual Machine ...........................................................................................................12 4. Full Script ......................................................................................................................................................13
  • 3. Creating a Wanos VM on Azure Page 3 of 15 1. INTRODUCTION This document details the steps that need to be taken to get a Wanos Virtual Machine (VM) up and running on Microsoft Azure. Azure has two deployment models, Azure Service Manager (ASM) and Azure Resource Manager (ARM). This guide uses the ARM deployment model which is the preferred deployment model as communicated by Microsoft. More information on the details of each model can be found here: https://docs.microsoft.com/en- us/azure/azure-resource-manager/resource-manager-deployment-model 2. WINDOWS POWERSHELL The Wanos VM is deployed using Windows PowerShell. To install PowerShell please visit this link and follow the steps provided: https://docs.microsoft.com/en- us/powershell/scripting/setup/installing-windows-powershell?view=powershell-5.1. Please ensure you have the latest version of PowerShell installed. You will also need to have the AzureRM Module installed. To check if this is included with your version of PowerShell please run the following command: Get-Module -ListAvailable AzureRM If you do not have the AzureRM Module installed or if the module is a version earlier than 3.6. then please go to this link and follow the instructions: https://docs.microsoft.com/en-us/powershell/azure/install-azurerm- ps?view=azurermps-4.3.1 You can also use the Azure Portal (https://portal.azure.com) to configure many of the settings that the PowerShell steps in this document take. This document only details the PowerShell steps needed to get your Wanos VM up and running. 3. WANOS VM INSTALL STEP-BY-STEP 3.1. Logging in to Azure Resource Manager To login to Azure Resource Manager run the following at Azure PowerShell prompt: Login-AzureRmAccount You will be presented with a web login box. Enter your Azure Subscription Account details and the password when prompted to do so as shown in the images below.
  • 4. Creating a Wanos VM on Azure Page 4 of 15 Once you have logged in successfully you will be provided with the details of the subscription as shown in the image below. If your Azure account has access to multiple subscriptions you need to select which subscription you are going to deploy Wanos to. To get a list of subscriptions run the following command: Get-AzureRmSubscription Then run: Select-AzureRmSubscription -SubscriptionName <Subscription Name>. In the example below the subscription name is chrislazari.
  • 5. Creating a Wanos VM on Azure Page 5 of 15 3.2. Setting Global Variables The script that creates the Wanos VM for you uses many variables that need to be set before you start running the necessary cmdlets. Below is the list of variables and details about each one.  $subscriptionName = "chrislazari" – Must change to your subscription name. In this example, it is chrislazari  $resourceGroupName = "Wanos" – This is the resource group that will be created and will house all the necessary resources for Wanos. If you have no resource group named Wanos, then it is recommended you use the default set in this example.  $locationName = "westeurope" – This variable sets the Azure Data Center location where you Wanos resources will be hosted. In this example, we are using the West Europe Data Center. To see a list of Azure Data Centers run the following PowerShell command: Get-AzureLocation or visit this link: https://azure.microsoft.com/en-us/overview/datacenters/how-to-choose/  $virtualNetworkName = "Wanos_Network" – This variable sets the network name which your VM will be running on. You can leave it as shown or change it.  $virtualNetworkSubnetName = "Subnet1" – This variable sets the subnet name on the virtual network you will be creating. You can leave it as shown or change it.  $virtualPublicIpName = "Wanos_Public_IP" – This variable sets the name for the Public IP resource as it will be displayed on the Resource Manager. You can leave it as shown or change it.  $virtualNICName = "WanosNIC01" – This variable sets the name for the Virtual Network Interface Card resource as it will be displayed on the Resource Manager. You can leave it as shown or change it.  $networkSecurityGroupName = "Wanos_NSG" – This variable sets the name for the Network Security Group that will be created. You can leave it as shown or change it.  $virtualMachineName = "Wanos_VM" – This variable sets the name of your Wanos virtual machine. You can leave it as shown or change it.  $virtualMachineSize = "Basic_A2" – This variable sets the size of the VM that will be running Wanos. The current setting of “Basic_A2’ has sufficient resources that meet the minimum required specification. For a list of possible Azure virtual machine sizes run the command Get-AzureRmVMSize $locationName | Out-GridView after setting the $locationName variable.  $virtualMachineOSDiskName = "Wanos_OS" – This variable sets the name of your Wanos virtual machine Disk. You can leave it as shown or change it.
  • 6. Creating a Wanos VM on Azure Page 6 of 15  $storageAccountName = "wanostest" – Set this variable to your storage account or alternative set the storage account name that will be created in section 3.8. This will be to house the Wanos Virtual Hard Disk (VHD). Note that every storage account name on Azure must be unique so if a name that you have chosen has been taken you will need to change this variable. All storage names must be in lower case and can only consist of letters and numbers. In this example, we are using wanostest.  $storageSKUName = "Standard_GRS" – This variable sets the SKU of the storage account i.e. the necessary redundancy and associated cost. You can find a list of possible SKU’s on this webpage: https://docs.microsoft.com/en-us/powershell/module/azurerm.storage/new- azurermstorageaccount?view=azurermps-4.3.1. In this example, we are using Standard_GRS which is Geo-redundant storage.  $storageContainerName = "vhd" – This variable sets the name for the storage container within the storage account hosting the Wanos VHD. You can leave it as shown or change it.  $sourceVHD = “https://wanosds.blob.core.windows.net/vhd/wanos-3.2.3-ub.vhd” - This variable sets the location of the source VHD. This variable must be set as shown here.  $destinationBLOB = "wanos.vhd" – This variable sets the name of the Wanos VHD once it is copied to your storage container. You can leave it as shown or change it.  $destinationvhd ="https://wanostest.blob.core.windows.net/vhd/wanos.vhd" – This variable sets the VHD location the VM will use once its configured. It must be set as is. You must ensure you change the text in red to your storage account name or create a new one in section 3.8. In this example, it is wanostest. Run each command to ensure your variables are all set for the scripts as shown in the image below. 3.3. Create a new Resource Group The first step in creating the Wanos VM is to create a Resource Groupon Azure which will house all the resources needed for the Wanos VM. To create a new Resource Group run the following command:  New-AzureRmResourceGroup -Location $locationName -Name $resourceGroupName
  • 7. Creating a Wanos VM on Azure Page 7 of 15 3.4. Create and Configure a new Virtual Network The Wanos VM requires a virtual network to host it on Azure. Run the following commands to create and configure the Virtual Network.  New-AzureRmVirtualNetwork -ResourceGroupName $resourceGroupName -Name $virtualNetworkName -AddressPrefix 10.101.0.0/16 -Location $locationName  $vnet = Get-AzureRmVirtualNetwork -ResourceGroupName $resourceGroupName -Name $virtualNetworkName  Add-AzureRmVirtualNetworkSubnetConfig -Name $virtualNetworkSubnetName - VirtualNetwork $vnet -AddressPrefix 10.101.1.0/24  Set-AzureRmVirtualNetwork -VirtualNetwork $vnet 
  • 8. Creating a Wanos VM on Azure Page 8 of 15 3.5. Create and Configure a Virtual Network Interface The Wanos VM requires a virtual network interface to connect to the virtual network created in the previous step. Run the following commands to create and configure the Virtual Network Interface.  $virtualNetwork = Get-AzureRmVirtualNetwork -ResourceGroupName $resourceGroupName -Name $virtualNetworkName  $publicIp = New-AzureRmPublicIpAddress -Name $virtualPublicIpName - ResourceGroupName $ResourceGroupName -Location $locationName -AllocationMethod Dynamic
  • 9. Creating a Wanos VM on Azure Page 9 of 15  $networkInterface = New-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName -Name $virtualNICName -Location $locationName -SubnetId $virtualNetwork.Subnets[0].Id -PublicIpAddressId $publicIp.Id 3.6. Create and Configure a Network Security Group The next step is to create and configure a Network Security Group (NSG) and bind it to the virtual NIC created in the previous step. The NSG manages access to and from your Wanos VM. To create a Network Security Group and bind it to the virtual NIC run the following commands:  $nsg = New-AzureRmNetworkSecurityGroup -ResourceGroupName $ResourceGroupName - Location $locationName -Name $networkSecurityGroupName  $nic = Get-AzureRmNetworkInterface -ResourceGroupName $ResourceGroupName -Name $virtualNICName  $nic.NetworkSecurityGroup = $nsg  Set-AzureRmNetworkInterface -NetworkInterface $nic
  • 10. Creating a Wanos VM on Azure Page 10 of 15 3.7. Create Network Security Group Access Rules Now that the NSG has been created we need to configure access rules to allow traffic inbound to the Wanos VM. Wanos requires SSH access as well as HTTPS access. To configure these rules run the following commands.  Get-AzureRmNetworkSecurityGroup -ResourceGroupName $ResourceGroupName | Add- AzureRmNetworkSecurityRuleConfig -Name tunnel-rule -Description "Allow UDP 4050" -Access Allow -Protocol Udp -Direction Inbound -Priority 100 - SourceAddressPrefix Internet -SourcePortRange * -DestinationAddressPrefix * - DestinationPortRange 4050 | Set-AzureRmNetworkSecurityGroup  Get-AzureRmNetworkSecurityGroup -ResourceGroupName $ResourceGroupName | Add- AzureRmNetworkSecurityRuleConfig -Name ssh-rule -Description "Allow SSH" - Access Allow -Protocol Tcp -Direction Inbound -Priority 101 - SourceAddressPrefix Internet -SourcePortRange * -DestinationAddressPrefix * - DestinationPortRange 22 | Set-AzureRmNetworkSecurityGroup  Get-AzureRmNetworkSecurityGroup -ResourceGroupName $ResourceGroupName | Add- AzureRmNetworkSecurityRuleConfig -Name https-rule -Description "Allow HTTPS" - Access Allow -Protocol Tcp -Direction Inbound -Priority 102 - SourceAddressPrefix Internet -SourcePortRange * -DestinationAddressPrefix * - DestinationPortRange 443 | Set-AzureRmNetworkSecurityGroup 3.8. Create Storage Account and Storage Container Now that the network configuration is complete we need to configure the storage that will house the Wanos VHD. First, we need a Storage Account and within that Storage Account we need a Storage Container. To create these run the following commands.  New-AzureRmStorageAccount -ResourceGroupName $ResourceGroupName -AccountName $storageAccountName -Location $locationName -SkuName $storageSKUName
  • 11. Creating a Wanos VM on Azure Page 11 of 15  $keys = Get-AzureRmStorageAccountKey -ResourceGroupName $ResourceGroupName - Name $storageAccountName  $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $keys[0].Value  New-AzureStorageContainer -Context $storageContext -Name $storageContainerName 3.9. Copy Wanos VHD to Local Storage Container Now that the storage has been created we can copy the Wanos VHD from its source. To do this run the following commands.  $keys = Get-AzureRmStorageAccountKey -ResourceGroupName $ResourceGroupName - Name $storageAccountName  $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $keys[0].Value  $blob1 = Start-AzureStorageBlobCopy -srcUri $sourceVHD -DestContainer $storageContainerName -DestBlob $destinationBLOB -DestContext $storageContext
  • 12. Creating a Wanos VM on Azure Page 12 of 15 3.10. Create Wanos Virtual Machine Everything is now in place to create the Wanos VM and get it up and running. To do this run the following commands.  $vmConfig = New-AzureRmVMConfig -VMName $virtualMachineName -VMSize $virtualMachineSize  $vmConfig = Set-AzureRmVMOSDisk -VM $vmConfig -Name $virtualMachineOSDiskName - VhdUri $destinationVhd -CreateOption Attach -Linux  $vmConfig = Add-AzureRmVMNetworkInterface -VM $vmConfig -Id $networkInterface.Id  $vm = New-AzureRmVM -VM $vmConfig -Location $locationName -ResourceGroupName $resourceGroupName The process is now complete. To check that everything is in place got to the Azure Portal (https://portal.azure.com) and open up the Resource Group you created. You should see all the resources listed there as per the image below. To login to your VM open the VM Overview by clicking on the VM icon in the image above. Make a note of the Public IP Address as shown in the image below and then use your favourite SSH client to login to the VM.
  • 13. Creating a Wanos VM on Azure Page 13 of 15 The username is tc and the password is ChangeM3 4. FULL SCRIPT For ease of use here is the full script with comments. # Login to Azure Resource Manager Login-AzureRmAccount # Select the Azure Subscription where you want to deploy Wanos to Select-AzureRmSubscription -SubscriptionName chrislazari # Set your global variables $subscriptionName = "chrislazari" # Enter your subscription name here $resourceGroupName = "Wanos" # Enter a unique resource group name or leave as wanos $locationName = "westeurope" # Enter which Azure location you want your resources to reside in $virtualNetworkName = "Wanos_Network" # Enter a unique network name or leave as default $virtualNetworkSubnetName = "Subnet1" # Enter a unique subnet name or leave as default $virtualPublicIpName = "Wanos_Public_IP" # Enter a descriptive name for the Public IP Address or leave as default $virtualNICName = "WanosNIC01" # Enter a descriptive name for the Virtual Network Interface Card or leave as default $networkSecurityGroupName = "Wanos_NSG" # Enter a descriptive name for the Network Security Group or leave as default $virtualMachineName = "Wanos_VM" # Enter a descriptive name for the Virtual Machine or leave as default $virtualMachineSize = "Basic_A2" # Enter an Azure VM Size. The current setting is the minimum requirement for Wanos $virtualMachineOSDiskName = "Wanos_OS" # Enter a descriptive name for the VM OS Disk or leave as default $storageAccountName = "wanostest" # Enter a descriptive Storage Account Name or leave as default $storageSKUName = "Standard_GRS" # Leave as default $storageContainerName = "vhd" # Leave as default $sourceVHD = "https://wanosds.blob.core.windows.net/vhd/wanos-3.2.3-ub.vhd" # Leave as default $destinationBLOB = "wanos.vhd" # Leave as default $destinationvhd ="https://wanostest.blob.core.windows.net/vhd/wanos.vhd" # Leave as default # Create a new Resource Group
  • 14. Creating a Wanos VM on Azure Page 14 of 15 New-AzureRmResourceGroup -Location $locationName -Name $resourceGroupName # Create and Configure a new Virtual Network New-AzureRmVirtualNetwork -ResourceGroupName $resourceGroupName -Name $virtualNetworkName - AddressPrefix 10.101.0.0/16 -Location $locationName $vnet = Get-AzureRmVirtualNetwork -ResourceGroupName $resourceGroupName -Name $virtualNetworkName Add-AzureRmVirtualNetworkSubnetConfig -Name $virtualNetworkSubnetName -VirtualNetwork $vnet - AddressPrefix 10.101.1.0/24 Set-AzureRmVirtualNetwork -VirtualNetwork $vnet # Create and Configure a Virtual Network Interface $virtualNetwork = Get-AzureRmVirtualNetwork -ResourceGroupName $resourceGroupName -Name $virtualNetworkName $publicIp = New-AzureRmPublicIpAddress -Name $virtualPublicIpName -ResourceGroupName $ResourceGroupName -Location $locationName -AllocationMethod Dynamic $networkInterface = New-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName -Name $virtualNICName -Location $locationName -SubnetId $virtualNetwork.Subnets[0].Id -PublicIpAddressId $publicIp.Id # Create and Configure a Network Security Group and bind it to the Virtual NIC $nsg = New-AzureRmNetworkSecurityGroup -ResourceGroupName $ResourceGroupName -Location $locationName -Name $networkSecurityGroupName $nic = Get-AzureRmNetworkInterface -ResourceGroupName $ResourceGroupName -Name $virtualNICName $nic.NetworkSecurityGroup = $nsg Set-AzureRmNetworkInterface -NetworkInterface $nic # Create and add SSH and HTTP Rules to Network Security Group Get-AzureRmNetworkSecurityGroup -ResourceGroupName $ResourceGroupName | Add- AzureRmNetworkSecurityRuleConfig -Name ssh-rule -Description "Allow SSH" -Access Allow -Protocol Tcp - Direction Inbound -Priority 100 -SourceAddressPrefix Internet -SourcePortRange * -DestinationAddressPrefix * -DestinationPortRange 22 | Set-AzureRmNetworkSecurityGroup Get-AzureRmNetworkSecurityGroup -ResourceGroupName $ResourceGroupName | Add- AzureRmNetworkSecurityRuleConfig -Name web-rule -Description "Allow HTTP" -Access Allow -Protocol Tcp - Direction Inbound -Priority 101 -SourceAddressPrefix Internet -SourcePortRange * -DestinationAddressPrefix * -DestinationPortRange 80 | Set-AzureRmNetworkSecurityGroup # Create Storage Account and Storage Container for Wanos VHD New-AzureRmStorageAccount -ResourceGroupName $ResourceGroupName -AccountName $storageAccountName -Location $locationName -SkuName $storageSKUName $keys = Get-AzureRmStorageAccountKey -ResourceGroupName $ResourceGroupName -Name $storageAccountName $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName - StorageAccountKey $keys[0].Value New-AzureStorageContainer -Context $storageContext -Name $storageContainerName # Copy Wanos VHD to Local Storage Container
  • 15. Creating a Wanos VM on Azure Page 15 of 15 $keys = Get-AzureRmStorageAccountKey -ResourceGroupName $ResourceGroupName -Name $storageAccountName $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName - StorageAccountKey $keys[0].Value $blob1 = Start-AzureStorageBlobCopy -srcUri $sourceVHD -DestContainer $storageContainerName -DestBlob $destinationBLOB -DestContext $storageContext #Sleep for 5 minutes to ensure copy is completed before starting VM creation Start-Sleep -s 300 # Create and Configure Virtual Machine $vmConfig = New-AzureRmVMConfig -VMName $virtualMachineName -VMSize $virtualMachineSize $vmConfig = Set-AzureRmVMOSDisk -VM $vmConfig -Name $virtualMachineOSDiskName -VhdUri $destinationVhd -CreateOption Attach -Linux $vmConfig = Add-AzureRmVMNetworkInterface -VM $vmConfig -Id $networkInterface.Id $vm = New-AzureRmVM -VM $vmConfig -Location $locationName -ResourceGroupName $resourceGroupName