Azure


How to convert OVA to VHDX for Hyper-V

If you have found yourself in a scenario where you would like to use Hyper-V as a test environment for your virtual machines, but you are using VMware ESXi Server,Citrix XenServer or VirtualBox then this tutorial is for you.

Required software

  • Microsoft Virtual Machine Converter 3.0 available here.
  • WinRar (or any tool you prefer to extract .tar files)
  • Your OVA export unzipped into a folder.

Preparations

  • Download and install Microsoft Virtual Machine Converter 3.0.

An OVA file is simply a tar archive file containing the OVF directory. First you rename the .ova file to a .tar extension. Now you can use WinRAR and extract the .vmdk files within to get the virtual machines disks. VMDK is an open format used by VMware and other vendors.

Convert The Image

Next we will need to convert our VMware Image in order for Hyper-V to run it. This can be done using Powershell:

Copy you .VHDX to the folder containing you Hyper-V virtual machine.  When creating your new virtual machine, you must ensure you select “Generation 1” when choosing the generation of the virtual machine :


How to troubleshoot your Linux VM running on Microsoft Azure

Many people are running Linux in a virtual machine on Azure. But what if a Linux virtual machine refuses to start?

Go to the Azure portal and open the virtual machine properties. First check out the CPU, network and disk utilization. Is CPU constantly peaking at 100%? Then you know that you must investigate that first. You see absolutely no utilization at all? Then your virtual machine might be down or doing nothing at all. When your virtual machine is slowly but online, maybe you have choosen the wrong virtual machine type and do you require more resources.

Ok… let’s choose the troubleshoot option. (The screendumps are from the dutch Azure website)

When you choose the troubleshoot option, you see the current resource status. A green sign means that there should be no problems with the Azure platform resources you are running on. In my case I see a green sign, so that’s a good! You also see the latest issues and activities. Did someone recently restart your virtual machine? You should see a notice of that. Remember how important it is to take security in mind. Are you and your co-workers all using the same account? Then it can be difficult to identify who rebooted the server.

You also see most common issues regarding your type of virtual machine. Just click on a problem and Microsoft gives you advice. You directly have the option to check for the tips that Microsoft gives you.

Console session

Most system administrators first instinct is to check the console screen. Unfortunately there is no live console screen which you can use. So you can’t monitor the boot process (and see the errors occurring) realtime. But there are ways to monitor it with a alternative method. Let’s go to the first option and click the first link:

After you’ve selected the first option you notice the follow screen:

You notice the latest boot process. You can scroll down this window. Notice the options to download the logfile, and to take a screendump and download it. You can’t see a live screen of the console but you’re able to download a screendump of the console. Not ideally but it can provide you with some interesting info.

Reset password

Sometimes there is a problem with your password.  Maybe you forgot your password!? You can use CLI or Powershell to change it.  You can find more info here and here. When you have full access to azure and the virtual machine you can reset your root password without knowing the current password.

Check for a pending reboot

Maybe some actions required a reboot and for that reason some services are not running. Check if the file /var/run/reboot-required exists or not. If it exists then you first have to reboot your Linux virtual machine before further troubleshooting.

Restart your virtual machine

There could be a resource problem or a hanging process. Choose to restart your virtual machine. Click on restart virtual machine to restart it. Use the console and boot information mentioned earlier to check the progress.

Reset the SSH connection creds

Sometimes there could be an issue with your SSH keys. Choose this option to recreate your SSH keys. (Option 4)

Migrate your Virtual machine to another host

You have the option the migrate (move) your virtual machine to another host. Sometimes there could be a problem with a specific region or host Use this option to make sure that this doesn’t apply to you.

Consider the use of premium storage

Check your number of IO’s. Do you have a application which requires a lot of IO? Consider the use of premium storage. Microsoft Azure Premium Storage delivers high-performance, low-latency disk support for virtual machines running I/O-intensive workloads. VM disks that use Premium Storage store data on solid state drives. You can migrate your application’s VM disk to Azure Premium Storage to take advantage of the speed and performance of these disks. But be aware of the costs! If your disks does not require high IOPS, you can limit costs by maintaining it in Standard Storage, which stores virtual machine disk data on Hard Disk Drives insteads of SSD’s. More info here.

Revert or fallback to your latest snapshot/backup

Sometimes it’s easier not to troubleshoot but to restore your latest backup and/or snapshot. Especially if you have a working (and tested!) backup and are able to restore

Conclusion

Microsoft provides more and more support for Linux virtual machines. The not real time console session is a bummer but Microsoft offers a lot of tips for you to take a clooser look at. I hope that this post will provide you with a good place to start your investigation. Make sure you have a working (and tested!) back-up plan in order. Everyone needs a restore or one point or another. 🙂 Microsoft also provides support plans, costs are $ 250 monthly with a minimum term of 6 months. You can always fallback on Microsoft’s Linux team which has advanced knowledge but for a price..


File level restore on Azure

Making backups of virtual machines running on Azure using snapshot technology is a nice feature. But sometimes you don’t want to revert the whole snapshot but only want to restore a single file. Now this is possible. It uses the same backup/Snapshot technology you probably are already using.

Azure_file_level_restore_1

Open the virtual machine properties in the all resources tab. Choose the Back-up option.

Azure_file_level_restore_2

Go to the file level restore option. (more/upper right)

Azure_file_level_restore_3

Select the back-up set containing the file(s) you wish to restore. Then choose to download the script. Upload that script to your Virtual Machine. (winscp, copy/paste into nano/vi or any other way you choose to). It takes approx. 1 minute to generate and download the script.

Execute the script using bash <filename.sh>. First time the VM adds support for the iSCSI service which is required for mounting the back-upset. Choose Y for installation the iSCSI drivers and wait a few seconds. You see that entire back-upset is mounted. Now you can copy all the necessary files you need.

After you are ready, go to the Azure portal and choose to unmount the back-upset. Now you are all finished!


Powershell: Start using PowerShell using PowerShell Command Builder

Microsoft TechNet site has a great site that enables you to build your own cmdlets using a web drag and drop interface.

There is support for :

image

Let’s try Office 365 :

image

You notice the drag and drop interface. First select the verb, for example Get. Click get and the send arrow. Now choose a Noun, for example Msol User:

image

After selecting the Verb and Noun you notice the other extra options. Fill them in when needed. Now hit the Copy to Clipboard button to copy the PowerShell command to your Clipboard and start using PowerShell to manage your Office 365.

You can find the site here.


Office 365 Powershell: Delegate Calender rights

Use the following steps to delegate (Calender) rights to a specific user.

First step specify your (administrator) credentials:

$LiveCred = Get-Credential

Create the session:

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic –AllowRedirection

Now import the Office 365 session using the following command:

Import-PSSession $Session

Use the following command to delegate the calender from user1 to specified user2

Add-MailboxFolderPermission -Identity user1@domain.com:\calendar -user user2@domain.com -AccessRights Editor

SNAGHTMLb41a829

Et voilà! The calender rights are set.


Howto : Backup to Azure with your Synology

Like many other people I use a Synology NAS for back-up purposes. All my backup data and other files is stored on the single device. But what when there is a problem with that device or your house (or office) is burned down to the ground. You won’t be able to gain access to your Synology and your data.

There are many (and I mean many!) services and (Cloud backup) providers who offer services to let you use their storage to backup to. Nice idea, great service. But…. not always very cheap. I have several Synology’s and many TB stored on them.

I tested several solutions and found out that backup to Azure was the right solution for me! In this blogpost I shall describe to few simple steps for you. You need 2 things:

  1. Synology Device
  2. Microsoft Azure Account (free trial available, go to azure.microsoft.com)

First step, we must create a storage account.

image

Ok, go through the following step to create a storage account :

image

Ok, you have to wait a few seconds for Microsoft to let that account be created. When the storage account is created you have to access the properties and go to Access Keys.

SNAGHTML2eca6106

You need the Storage Account Name and the Access Key (KEY1 or KEY2) later.

Now go to your Synology. Ofcourse you are running the latest version and go to Hyper Backup.

SNAGHTML2ecc4566

Click the + button to add a back-up job.

image

Wow! We see the AZR Cloud already, let’s select that!

SNAGHTML2ece3fa0

Fill in you Account name and copy/paste the contents of KEY1:

image

You have the option to backup some applications, let’s skip that.

image

Fill in the appropriate information and you are all done!

The costs are as follows :

  1. You pay 0,02 cent (euro) for every GB of storage
  2. When you back-up 20 TB, you pay approx 20 euro each month
  3. You only pay for storage and restoring, not for uploading.
  4. When you restore the entire 1 TB storage you pay 1x approx 72 euro

How to publish a remoteapp (Azure)

In this article I describe how to publish a remoteapp using Microsoft Azure. First login to the Azure Portal using your (admin) creds and create a RemoteApp :

image

After you select the +NEW button use the following steps to create a RemoteApp:

image

Give a name, the region you wish the data to be stored and the plan details. Notice that by default there are 3 images to choose from. In this example who use the default available. In a later post I shall describe how to use your own images. After you click Create RemoteApp Collection, your RemoteApp Collection will be created. This can take a couple of minutes. When this task is finished you see something like this :

image

The name, status, address and other information is displayed. Double-click this bar.

You notice this screen:

image

You have several options : Dashboard (this page), User Access (control which users have access), Publishing (choose which applications to publish), Sessions (see the current sessions), Scale (scale your RemoteApp)

Click publish remoteapp programs!

image

Now you can choose from a list of programs installed in the image you choose before. Select any of them. You see the selected program being published. You can go to the publishing menu and you see al the Apps which are published as a RemoteApp.

image

It’s also an option to manually enter programs when you now the exact path or any one which is listed in the start menu. Ok! We are ready to go. Let’s download the Azure RemoteApp client here. After you have installed the client, let’s start the client! Login as the user you gave access to earlier. (users) and you see something like this :

SNAGHTML19a3dfbe

Let’s start Visio for example :

image

The first time to application is set up (profile etc) and so it takes a bit langer to start the application.

Et voila Visio is started! You don’t see the difference between Visio installed locally or as a RemoteApp :

image


Using Azure to monitor website availability and responsiveness

In this blog post I describe how you easily can monitor the performance and the availability of a website. You need an Azure (trial-) account and Visual Studio Enterprise (or Ultimate). There are multiple options, but in this post I describe the URL ping test and the Multi-step web test.

The ping test is an easy way to start. From 5 multiple locations all over the world Azure send an ping to the specified website.

Ping Test

First login to your Windows Azure account. Make sure you’ve already created an Application Insight Resource. Check the following pictures how to create :

image

Create the Application Insight:

image

Specify a name and choose for ASP.NET

image

Go to your Application Insight Resource and Add a web test.

SNAGHTML9e9402

Specify a name, the URL ping test type and the test frequency. Make sure you add the http prefix to the url specification.

image

When you are ready wait when the test has been completed (this can take some time) go to your Application Insight Resource Tile.

Click the Availability Tile and check your results.

SNAGHTML450734

See the above example for the number of tests and the performance.

Multiple-step test

First make sure you have Visual Studio Enterprise 2015 Enterprise or Ultimate. Create a new project :

image

Choose a unique name and create a new project. Select the .webtest file and click the red record button.

image

Record the actions you wish to test and click stop when you’re finished.

SNAGHTMLa3cfab

Alright, test the file. And save the file. Now go Azure and choose to Add a web test :

SNAGHTMLa63a52

Fill in the webtest name and upload the .webtest file.

image

All done. Glimlach Now watch your Azure portal and see the new test appearing.