Linux on Azure—a Strange Place to Find a Penguin

What's the Root Password!?!?

Users of other VPS systems may wonder where they specify the root password. The answer is simple: you don't. Whatever account you specify will be given sudo authority to su to root:

[andrew@penguin1 ~]$ sudo su -
[sudo] password for andrew:
[root@penguin1 ~]#

From that point, you could set the root password if you want with passwd.


Linux virtual machines have three types of storage.

First, each is given a 30GB root volume. Storage is locally redundant and optionally can be made geographically redundant for about a 33% cost increase. Unfortunately, short of creating your own template, there is no way to modify this 30GB configuration if you prefer a different filesystem layout or want a smaller monthly storage bill. Root volume data persists across reboots and is a permanent BLOB in Azure storage. So if you delete a VM, it's possible to retain its root volume and later mount it up on another system or use it as the root volume for a new VM.

You also can create as many other volumes as you'd like. These live as BLOBs in Azure storage and are persistent. They function much like SAN volumes, allowing you to create and attach them to one VM, then later unmount and attach to another. Unfortunately, there is no way to resize these volumes, which is a disappointing limitation. While you can create a larger volume, move data and delete the old volume, this obviously is not a scalable approach.

When you create a new disk and attach it to the VM, it appears as a new SCSI device that you can mkfs and mount. After creating a new 20GB disk in the Azure portal, penguin1's dmesg shows:

scsi 4:0:0:0: Direct-Access  Msft   Virtual Disk  1.0  PQ: 0 ANSI: 4
sd 4:0:0:0: Attached scsi generic sg3 type 0
sd 4:0:0:0: [sdc] 41943040 512-byte logical blocks: (21.4 GB/20.0 GiB)
sd 4:0:0:0: [sdc] Write Protect is off
sd 4:0:0:0: [sdc] Mode Sense: 0f 00 10 00
sd 4:0:0:0: [sdc] Write cache: enabled, read cache: enabled, 
  supports DPO and FUA
 sdc: unknown partition table
sd 4:0:0:0: [sdc] Attached SCSI disk

Now you can fdisk, mkfs and mount:

[root@penguin1 ~]# fdisk /dev/sdc
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
Partition number (1-4): 1
First cylinder (1-2610, default 1): 
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-2610, default 2610):
Using default value 2610

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@penguin1 ~]# mkfs.ext4 /dev/sdc1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
1310720 inodes, 5241198 blocks
262059 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
160 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 
        1605632, 2654208, 4096000

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 21 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

[root@penguin1 ~]# mkdir /data
[root@penguin1 ~]# mount /dev/sdc1 /data
[root@penguin1 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
                       28G  2.0G   24G   8% /
tmpfs                 872M     0  872M   0% /dev/shm
/dev/sda1             485M   86M  374M  19% /boot
/dev/sdb1              69G  180M   66G   1% /mnt/resource
/dev/sdc1              20G  172M   19G   1% /data

As you might expect, if I were to delete this disk in the Azure portal, the operation would fail unless I first unmounted it.

Finally, virtual machines also come with a variable amount of truly local storage. This storage does not live in the Azure cloud but rather is provisioned on the actual physical node. If there is a hardware or other fault in the Azure fabric and your VM migrates to a new host, data stored in this space is lost. This filesystem is meant to be used for state information, scratch data and other temporary files. On Linux images, it shows up as /mnt/resource. Small VMs receive a 70GB filesystem, and the size increases with VM size, up to 800GB for Extra Large VMs.

I have experienced a hardware fault on Azure. My VM shut down, migrated to a new hardware host and booted up on the new server. Services that I'd defined to start up came up normally, all network endpoints were moved correctly, disks I'd mounted were remounted, and the VM worked fine. However, the scratch data I had in /mnt/resource was lost, and the filesystem was empty, as designed.

Rough Edges

The CentOS image could use some improvement. Provided by OpenLogic, I've noted some things that make me scratch my head:

  • A swap partition is configured, but does not appear in /etc/fstab. Because there isn't much advantage to creating a swap partition but not using it, this is presumably an oversight.

  • Some default services run without justification. For example, why is CUPS needed? I'm unlikely to print in the cloud. Given that RAID redundancy is provided by the Azure storage layer and software RAID is not needed, why is mdmonitor set to run at boot?

  • I periodically receive crash reports from fprintd. Removing this service is straightforward, but why the CentOS image is created to support fingerprint biometric authentication in a virtual, cloud-based environment mystifies me.

  • iptables is enabled with a single rule to accept bootp, though the INPUT chain has a default ACCEPT policy anyway.

Hopefully, these things will be corrected as Linux settles into Azure.


In general, I/O performance is excellent. Measuring with ioping, I found the /data disk I created earlier averaged 6ms latency, while /mnt/resource showed a zippy 0.4ms. The root disk was a slower 18ms, but as Microsoft explains in its documentation, it optimizes the I/O performance on volumes tagged "OS Disk" differently:

The operating system disk and data disk has a host caching setting (sometimes called host-cache mode) that enables improved performance under some circumstances. However, these settings can negatively affect performance in other circumstances, depending on the application. Host caching is OFF by default for both read operations and write operations for data disks. Host-caching is ON by default for read and write operations for operating system disks. As noted, these should work best in most cases. However, your mileage may vary. We recommend you place data intensive operations on a data disk separate from the OS disk.

Figure 6. The Integrated Display of Performance Metrics in the Azure Portal

Compute performance depends on the VM size you select. Under the covers, Microsoft is using AMD gear, as evidenced by /proc/cpuinfo:

processor       : 1
vendor_id       : AuthenticAMD
cpu family      : 16
model           : 8
model name      : AMD Opteron(tm) Processor 4171 HE
stepping        : 1
cpu MHz         : 2094.702
cache size      : 512 KB


Some may say the best thing about Linux in Azure is that it gives competition to Amazon and Google. For the end user, performance and pricing are very similar, while the enterprise administrator may find the ability to collocate Linux alongside Windows and Azure-specific deployments to be advantageous. While running Linux in the Azure cloud might seem like a penguin pitching his tent in Mordor, one more quality player in the cloud space is good news for all.


Andrew Fabbro is a senior technologist living in the Portland, Oregon, area. He's used Linux since Slackware came on floppies and presently works for Con-way, a Fortune 500 transportation company.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Engine Yard PaaS for Azure

Mike Mersch's picture

Thank you for this very informative post Andrew. Since this post Engine Yard, a leading OSS PaaS, formed a partnership with Windows Azure to provide an additional level of managed services for Developers choosing to take advantage of your advice. Ruby, PHP and Node.JS apps running on Linux, on Azure, is a great choice for cloud based web and mobile apps.

Thank you for the effort you

distribution prospectus paris's picture

Thank you for the effort you have made in creating this blog, better shared information that's also one of the values ​​of democracy ... if I can do anything to help this site I'd be happy .. Good luck!

Voyance gratuite par mail

Both EC2 and Azure are

Joe Borg's picture

Both EC2 and Azure are extremely expensive, for what you get. No one seems to be jumping on Digital Ocean's bandwagon. I've been using them for about 6 months now and a foot has not been put wrong.

Windows Azure now "General Availability" with Microsoft SLA

Mark Sorenson's picture

Scott Guthrie's Blog

Thanks Andrew for the review of Windows Azure and Linux. FYI, very recently (April 16) Microsoft announced General Availability of Windows Azure Infrastructure Services (i.e. Linux and Windows Virtual Machines, Virtual Network). This means users can now run their Virtual Machines in full production with a Service Level Agreement backed by Microsoft. As part of General Availability, new sizes are available for both Linux and Windows Virtual Machines. More info available at the Scott Guthrie Blog, link above.

Mark Sorenson
Product Planner for Infrastructure Services (IaaS, PaaS, Virtual Networks)
Windows Azure, Microsoft Corporation

Reply to comment | Linux Journal

Guides To Israel's picture

Hello there, I believe your blog may be having web
browser compatibility problems. Whenever I take a look at your blog in Safari, it looks fine but when opening in Internet Explorer,
it has some overlapping issues. I simply wanted to provide you with a quick heads up!
Other than that, great blog!