<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Norge i skyen - Microsoft Services sin blog om Azure</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/norgeiskyen/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/norgeiskyen/feed.xml</link>
    <description>News and information about Windows Azure solutions in Norway. And in the rest of the world.</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:51:54 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Provisioning and de-provisioning machines in Azure Virtual Machines</title>
      <link>https://docs.microsoft.com/archive/blogs/norgeiskyen/provisioning-and-de-provisioning-machines-in-azure-virtual-machines</link>
      <pubDate>Thu, 02 May 2013 07:32:00 GMT</pubDate>
      <dc:creator><![CDATA[Pål Bendiksen]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/norgeiskyen/2013/05/02/provisioning-and-de-provisioning-machines-in-azure-virtual-machines/</guid>
      <description><![CDATA[Now that we have a couple of Virtual Machines running in the cloud, the costs are continuously...]]></description>
      <content:encoded><![CDATA[<p>Now that we have a couple of Virtual Machines running in the cloud, the costs are continuously running. The good thing with the cloud is that we only pay for the machines that we need.<br />But wouldn't it be nice to pay only when you need it too?</p>
<p>Just&nbsp;one important piece of information. Stopping the machine will not stop the meter, so you will have to delete the virtual machine.</p>
<p>But you don't have to delete the disk, so you will still keep all your stuff. And you will be up and running in no time when you need to. Sweet :)</p>
<p>One of my colleagues created some simple powershell scripts to do this, and it works perfectly.</p>
<p>The first part of it is a config file that holds the parameters of the Azure service and the local path to store the VM configuration. And also information about virtual network and affinity group.</p>
<h2>The settings</h2>
<p>The file is named Settings.ps1 and here is the content.</p>
<p><span style="color: #339966;">$VMPath = '&lt;local path to store the VM configuration&gt;'</span><br /><span style="color: #339966;">$VirtualNetwork = "&lt;Azure Virtual Network&gt;"</span><br /><span style="color: #339966;">$AffinityGroup = "&lt;Affinity group&gt;"</span><br /><span style="color: #339966;">$AzureServiceName = "&lt;Azure Service&gt;"</span></p>
<h2>Exporting and removing the VM configuration</h2>
<p>The second part is a script for exporting the configuration and remove the VMs related to the service in $AzureServiceName. I called the file RemoveVMs.ps1</p>
<p><span style="color: #339966;">. .\Settings.ps1</span></p>
<p><span style="color: #339966;">write-host "Exporting settings and removing all VMs for Azure Service $AzureServiceName" -ForegroundColor Yellow</span><br /><span style="color: #339966;">write-host "Export path = $VMPath" -ForegroundColor Yellow</span><br /><span style="color: #339966;">Get-AzureVM | where {$_.ServiceName -eq $AzureServiceName} | foreach {&nbsp; </span><br /><span style="color: #339966;">&nbsp;&nbsp;&nbsp;&nbsp; $path = $VMPath + '\' + $_.Name + '.xml' </span><br /><span style="color: #339966;">&nbsp;&nbsp;&nbsp;&nbsp; Export-AzureVM -ServiceName $_.ServiceName -Name $_.Name -Path $path </span><br /><span style="color: #339966;">&nbsp;&nbsp;&nbsp;&nbsp; Remove-AzureVM -ServiceName $_.ServiceName -Name $_.Name </span><br /><span style="color: #339966;">} </span><br /><span style="color: #339966;">write-host "Removing Azure Service $AzureServiceName" -ForegroundColor Yellow</span><br /><span style="color: #339966;">Remove-AzureService -ServiceName $AzureServiceName -Force</span></p>
<p>&nbsp;</p>
<p>As you can see, the script imports the settings. Then it gets all VMs in the service, export the settings. Then it removes the VMs and in the end the service itself.</p>
<p>It is a good idea to test the script with the two remove commands commented out first to ensure that the configuration is exported correctly. You can then run it again with the remove enabled.</p>
<p>&nbsp;</p>
<h2>Importing the VM configuration</h2>
<p>The last part is the script to import the configuration and start up the machines again. I called the file ImportVMs.ps1</p>
<p><span style="color: #339966;">. .\Settings.ps1</span></p>
<p><span style="color: #339966;">write-host "Restoring VMs in Azure Service $AzureServiceName" -ForegroundColor Yellow</span><br /><span style="color: #339966;">write-host "Import path = $VMPath" -ForegroundColor Yellow</span></p>
<p><span style="color: #339966;">Get-ChildItem $VMPath\*.xml | foreach { </span><br /><span style="color: #339966;">&nbsp;&nbsp;&nbsp; $path = $_ </span><br /><span style="color: #339966;">&nbsp;&nbsp;&nbsp; Write-Host $path</span><br /><span style="color: #339966;">&nbsp;&nbsp;&nbsp; $vm = Import-AzureVM -Path $path</span><br /><span style="color: #339966;">&nbsp;&nbsp;&nbsp; $azureService = Get-AzureService |&nbsp; WHERE {$_.ServiceName -eq $AzureServiceName }</span><br /><span style="color: #339966;">&nbsp;&nbsp;&nbsp; if ($azureService -eq $null)</span><br /><span style="color: #339966;">&nbsp;&nbsp;&nbsp; {</span><br /><span style="color: #339966;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $vm | New-AzureVM -ServiceName $AzureServiceName -AffinityGroup $AffinityGroup -VNetName $VirtualNetwork</span><br /><span style="color: #339966;">&nbsp;&nbsp;&nbsp; }</span><br /><span style="color: #339966;">&nbsp;&nbsp;&nbsp; else</span><br /><span style="color: #339966;">&nbsp;&nbsp;&nbsp; {</span><br /><span style="color: #339966;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $vm | New-AzureVM -ServiceName $AzureServiceName -VNetName $VirtualNetwork&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><br /><span style="color: #339966;">&nbsp;&nbsp;&nbsp; }</span><br /><span style="color: #339966;">}</span></p>
<p>This script takes the config files that you have exported and creates the VMs in Azure again. The VMs will start up when finished.</p>
<p>And that's it :)</p>
<p>&nbsp;</p>
<h2>Gathering machines under one subscription</h2>
<p>So I promised in the last article to pick up on how to gather more machines under one subscription.</p>
<p>Here you can experiment on creating new scripts from the ones already provided to streamline the prosess. But what I find easiest is to just temporarily change the settings file to export the new machine.</p>
<p>Let's say I have created a new VM from the Azure Web UI and the machine is named palbenNEW. In the Settings.ps1 file you change $AzureServiceName to "palbenNEW". The palbenNEW service is hidden, so you will not see it in the interface. Unless you delete the VM in the, that will not delete the attached service, but make it visible.</p>
<p>Now you can run the RemoveVMs script (try exporting without the removes first) and it will export your configuration, putting it in the folder with the other machines.</p>
<p>Now change the $AzureServiceName back again.</p>
<p>When you now run the import script, it will put the last machine in the same service as the other ones.</p>
<h2>More information</h2>
<p>If you look at this session from the recent online Windows Azure Conference, you can pick up loads of other nice tips and tricks.<br /><a href="https://channel9.msdn.com/Events/windowsazure/Windows-AzureConf-2013/Essential-Iaas-for-Developers">https://channel9.msdn.com/Events/windowsazure/Windows-AzureConf-2013/Essential-Iaas-for-Developers</a></p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Moving a virtual machine from Hyper-V to Azure IaaS</title>
      <link>https://docs.microsoft.com/archive/blogs/norgeiskyen/moving-a-virtual-machine-from-hyper-v-to-azure-iaas</link>
      <pubDate>Fri, 26 Apr 2013 06:38:00 GMT</pubDate>
      <dc:creator><![CDATA[Pål Bendiksen]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/norgeiskyen/2013/04/26/moving-a-virtual-machine-from-hyper-v-to-azure-iaas/</guid>
      <description><![CDATA[Now that Azure IaaS is generally available, many people want to move Virtual Machines from...]]></description>
      <content:encoded><![CDATA[<p>Now that Azure IaaS is generally available, many people want to move Virtual Machines from on-premise to Windows Azure.<br />I will go through the steps needed to move an existing machine to Azure.</p>
<p>&nbsp;</p>
<p>First of all, the disk has to be a .VHD file. Currently Windows Azure Virtual Machines are not running on .VHDX files.<br />If you are running on a VHDX disk, you can convert it through Hyper-V manager.</p>
<h2>Converting .VHDX disk file to .VHD</h2>
<p><br />Start Hyper-V manager, Right-click the VM and Choose <strong>settings</strong></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/46/29/4555.Azureblog01.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-46-29/4555.Azureblog01.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/46/29/4555.Azureblog01.jpg" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-46-29/4555.Azureblog01.jpg" alt="" border="0" /></a></p>
<p>&nbsp;</p>
<p>Choose to <strong>convert</strong>, then next.</p>
<p>Choose <strong>VHD</strong> as disk format</p>
<p>Keep the disk type</p>
<p>Set the <strong>name</strong> and <strong>location</strong> of the new VHD file</p>
<p>Finish</p>
<p>Wait for the disk conversion to complete</p>
<h2>Preparing disk</h2>
<p>&nbsp;I you want to use the VHD for creating multiple machines in Azure you need to create an image in Azure. For Azure to be able to start a machine created from an image, you will want to run sysprep on it before you upload it.</p>
<p>If you just want to copy a&nbsp;machine to Azure for use as one Azure VM, you don't need to sysprep it.</p>
<h2>Getting the VHD uploaded to Azure</h2>
<p>For this you need to have an active Azure Subscription, you can get one at <a href="https://www.windowsazure.com">https://www.windowsazure.com</a><br />Create a storage account and a dedicated container for your VM disks.</p>
<p>First Option on is doing it through&nbsp;Windows Azure Powershell,&nbsp;you can download it from here:&nbsp;<a href="https://msdn.microsoft.com/en-us/library/windowsazure/jj554332.aspx">https://msdn.microsoft.com/en-us/library/windowsazure/jj554332.aspx</a></p>
<p>Second option is through a command in Node.js. This is my preferred option, simply because you can stop it and it will resume when you start it again. This is a big advantage when you are doing an upload that will take several hours to complete.<br />You may need to move outside of your Wi-Fi reach, network disruption, computer enters sleep mode, or any other issue that will disrupt your transfer during the hours it is running. Having to restart an upload after 6 hours is annoying.</p>
<p>So I will explain how to get the Node.js way to work.<br />- Install Node.js from <a class="linkified" href="https://nodejs.org/" rel="nofollow" target="_blank">https://nodejs.org/</a><br />- Run the command: <strong>npm install azure-cli -g</strong></p>
<p>Now Node.js is ready to run the upload command</p>
<p>Run: &nbsp;<strong>azure vm disk upload "&lt;local file path&gt;" "https://&lt;storage account&gt;.blob.core.windows.net/&lt;container&gt;/&lt;target VHD name&gt;.vhd" "&lt;storage account key&gt;"</strong></p>
<p>Now you should see something like this</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/46/29/3060.transfer.JPG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-46-29/3060.transfer.JPG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/46/29/3060.transfer.JPG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-46-29/3060.transfer.JPG" alt="" border="0" /></a></p>
<p>As you can see from this, it has completed 20% of 17GB in a little less than an hour. This is with a quite decent upload line, so do expect your uploads to take some time.</p>
<h2>Creating a disk or an image</h2>
<p>In this article I will only explain how to create and start the VM through the Windows Azure web portal. It has some shortcomings as you cannot specify a service name when creating the VM. For each VM it will create a new service.<br />In my next article, I will show some simple scripts to take up and down the machines (saving cost), and also explain how to gather the machines under one service.</p>
<p>Log in to <a href="https://windows.azure.com">https://windows.azure.com</a></p>
<p>We expect that the VHD file has been uploaded. You can browse your storage account to verify that.</p>
<p>Now we go into the <strong>Virtual Machines</strong> tab</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/46/29/2148.VM%20portal.JPG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-46-29/2148.VM-portal.JPG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/46/29/2148.VM%20portal.JPG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-46-29/2148.VM-portal.JPG" alt="" border="0" /></a></p>
<p>&nbsp;</p>
<p>If you have sysprepped the image on the disk and would like to use it for creating multiple VMs, click on the <strong>IMAGES</strong> link.</p>
<p>If you have not sysprepped or just want to create one VM, click on the <strong>DISKS</strong> link</p>
<p>&nbsp;</p>
<p>Click <strong>Create</strong> at the bottom of the page, and you will get this dialog</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/46/29/5775.createdisk.JPG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-46-29/5775.createdisk.JPG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/46/29/5775.createdisk.JPG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-46-29/5775.createdisk.JPG" alt="" border="0" /></a></p>
<p>&nbsp;</p>
<p>Enter a name for the disk</p>
<p>Browse for the URL of the blob that contains the VHD. If you can't find it, and you have verified that it is in the storage container, try again in a minute. It can take a short while for it to show here.</p>
<p>Choose OS and finish</p>
<p>&nbsp;</p>
<h2>Creating the machine</h2>
<p>Click <strong>+New</strong> in the bottom left corner</p>
<p>Choose Compute --&gt; Virtual Machine --&gt; From Gallery</p>
<p>Now the Create Virtual machine wizard opens</p>
<p>&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/46/29/0211.createmachine.JPG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-46-29/0211.createmachine.JPG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/46/29/0211.createmachine.JPG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-46-29/0211.createmachine.JPG" alt="" border="0" /></a></p>
<p>&nbsp;</p>
<p>If you choose to create an image, select <strong>My Images</strong>. I have a disk, so I choose <strong>My disks</strong> <br />If the disk or image is not there, just wait, it will soon be there</p>
<p>Choose your disk or image</p>
<p>Next step, you give the machine a name and set the size (and cost) for it.</p>
<p>Next step, you choose <strong>Stand-alone Virtual Machine. </strong>Give it a DNS name that is unique to the azure services.<br />Choose affinity group, region or virtual network<br />Select the subnet you want the VM to be on</p>
<p>The settings on the last tab doesn't really affect our implementation.</p>
<p>Finish the wizard, and the machine will start creating.</p>
<p>You will see several step being executed and at last your computer will show status <strong>Running</strong></p>
<p>Select the machine and click <strong>Connect</strong> at the bottom. You will now be given an RDP connection to the machine and you can use the credentials that were valid on the on-premise machine.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
  </channel>
</rss>