Thursday, January 8, 2015

Adding a RAID volume to Azure Linux VM


Breaking into our short OEM work I find I have to move it to some faster disk as  a single Azure BLOB has a 500 IOPS limit.   So we need to stripe a bunch of disks together.

To do this we first have to create them in Azure Control Panel ( I hate Powershell )


Click Attach Empty Disk at the bottom.   We will do  15x10G disks


]


Repeat till 10 done ! 

Sorry ( don't use Read/Write above , use None or you will run into a problem with it,  that onyl  4 R/W can be there ).



now lets' install mdadm

[root@ebscloud ~]# yum install mdadm
Loaded plugins: refresh-packagekit
public_ol6_addons                                                                                                                                         | 1.2 kB     00:00
public_ol6_addons/primary                                                                                                                                 |  77 kB     00:00
public_ol6_addons                                                                                                                                                        264/264
public_ol6_latest                                                                                                                                         | 1.4 kB     00:00
public_ol6_latest/primary                                                                                                                                 |  45 MB     00:03
public_ol6_latest                                                                                                                                                    29084/29084
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package mdadm.x86_64 0:3.2.6-7.el6_5.2 will be updated
---> Package mdadm.x86_64 0:3.3-6.el6_6.1 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================================================================================
 Package                              Arch                                  Version                                       Repository                                        Size
=================================================================================================================================================================================
Updating:
 mdadm                                x86_64                                3.3-6.el6_6.1                                 public_ol6_latest                                341 k

Transaction Summary
=================================================================================================================================================================================
Upgrade       1 Package(s)

Total download size: 341 k
Is this ok [y/N]: y
Downloading Packages:
mdadm-3.3-6.el6_6.1.x86_64.rpm                                                                                                                            | 341 kB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating   : mdadm-3.3-6.el6_6.1.x86_64                                                                                                                                    1/2
  Cleanup    : mdadm-3.2.6-7.el6_5.2.x86_64                                                                                                                                  2/2
  Verifying  : mdadm-3.3-6.el6_6.1.x86_64                                                                                                                                    1/2
  Verifying  : mdadm-3.2.6-7.el6_5.2.x86_64                                                                                                                                  2/2

Updated:
  mdadm.x86_64 0:3.3-6.el6_6.1

Complete!
[root@ebscloud ~]#

[root@ebscloud ~]# fdisk -l|grep 10
Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 26108 cylinders
/dev/sdc1               1       26108   209712478+  83  Linux
Disk /dev/sdd: 10.7 GB, 10737418240 bytes
Disk /dev/sde: 10.7 GB, 10737418240 bytes
Disk /dev/sdg: 10.7 GB, 10737418240 bytes
Disk /dev/sdf: 10.7 GB, 10737418240 bytes
Disk /dev/sdj: 10.7 GB, 10737418240 bytes
Disk /dev/sdi: 10.7 GB, 10737418240 bytes
Disk /dev/sdl: 10.7 GB, 10737418240 bytes
Disk /dev/sdm: 10.7 GB, 10737418240 bytes
Disk /dev/sdk: 10.7 GB, 10737418240 bytes
Disk /dev/sdh: 10.7 GB, 10737418240 bytes
Disk /dev/sdn: 10.7 GB, 10737418240 bytes

[root@ebscloud ~]#

so those are the disks.  Repeat for all 10

[root@ebscloud ~]# fdisk /dev/sdd
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xe1519968.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1305, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-1305, default 1305):
Using default value 1305
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@ebscloud ~]#



etc 
Now run mdadm --create /dev/md0 --verbose --level 0 --raid-devices 15 /dev/sdd1 /dev/sde1 /dev/sdg1 /dev/sdf1 /dev/sdj1 /dev/sdi1 /dev/sdl1 /dev/sdm1 /dev/sdk1 /dev/sdh1 /dev/sdn1 /dev/sdo1 /dev/sdp1 /dev/sdq1 /dev/sdr1

this will give you a Linux device /dev/md0 

then do mkfs.ext4 on it and mount it in fstab . 

Et Voila now you have a drive.   ( if you've messed up and built Grid Control on a slow disk we will now give you several hours to push it all across to the new drive and then remap drives etc ) 
.. all done..  several Azure features were bumped into like no more than 16 attached disks etc  

No comments: