Jump to content


Photo

Software RAID (mdadm) on XenServer 6.5 unexpected failure

Started by Artem Issayev , 26 January 2015 - 08:45 AM
17 replies to this topic

Best Answer edmarcos souza , 27 January 2015 - 01:25 AM

After spending yesterday and part of today I think I got the final solution to the soft raid on XenServer 6.5.
And I am providing a script for the same.
 
Brazil a country of all ...

 

http://www.guanabara.info/wp-content/uploads/2010/05/Brasil-Linux-Tux-Pinguim.jpg

Artem Issayev Members

Artem Issayev
  • 12 posts

Posted 26 January 2015 - 08:45 AM

Hi everyone,

I ran into a very unpleasant problem  :angry:  during setup mdadm software RAID 1 on my clean install XenServer 6.5 environment (3 servers, each with 2x local sata hdd).
I know that Citrix does not officially support a software (fake.....bla..bla...) raid installations. But when I used XenServer 6.2 with mdadm raid 1, it was works great and was my only salvation to backup my data on local disks.

Then I decided to upgrade to XenServer version 6.5  :( .

What I did:
  • I tried to start the update from XS 6.5 CD but of couse :D the installer did not see my mdadm-installed system.
  • Then I fully cleared (format, with all data and metadata deletion) all local drives.
  • I made a clean install of XenServer 6.5 on one of the disks (sda).
  • And began to setup mdadm software raid.

But when i start to create a md0/md1/md2 array's i see this error:

 
[root@blabla02 ~]# mdadm --create /dev/md0 --level=1 --raid-devices=2 missing /dev/sdb1
mdadm: Note: this array has metadata at the start and
    may not be suitable as a boot device.  If you plan to
    store '/boot' on this device please ensure that
    your boot-loader understands md/v1.x metadata, or use
    --metadata=0.90
Continue creating array? y
mdadm: unexpected failure opening /dev/md0

 

Is anyone can comment this error? Of course i now that its "officially not support". But it work's fine on 6.2 an it's the only one solution, i think not only for me! What the problem with 6.5?

 

Any ideas? 

 



Artem Issayev Members

Artem Issayev
  • 12 posts

Posted 26 January 2015 - 08:50 AM

With metadata correction the same error:

[root@blabla02 ~]# mdadm --create /dev/md0 --level=1 --raid-devices=2 --metadata=0.90 missing /dev/sdb1
mdadm: unexpected failure opening /dev/md0

 

As I said earlier, a clean install on a clean hdd drives... :(

 

p.s.... version of the XenServer 6.5 installation CD is : #90233c


Edited by Artem Issayev, 26 January 2015 - 09:17 AM.


Ruslan Ohitin Members

Ruslan Ohitin
  • 3 posts

Posted 26 January 2015 - 09:55 AM

XenServer 6.5 do not load soft raid kernel modules on boot. (See comments by Roland Monday on this article).

 

My solution is:

1. Create file /etc/sysconfig/modules/raid.modules with needed modules

# echo "modprobe raid1" > /etc/sysconfig/modules/raid.modules

you can add lines for another raid level (raid0 or raid10 for example)

 

2. Make this file executable

# chmod +x /etc/sysconfig/modules/raid.modules

 

3. Reboot.

 

PS: I do not know will this changes survive after installing patches



Artem Issayev Members

Artem Issayev
  • 12 posts

Posted 26 January 2015 - 10:51 AM

 

XenServer 6.5 do not load soft raid kernel modules on boot. (See comments by Roland Monday on this article).

 

My solution is:

1. Create file /etc/sysconfig/modules/raid.modules with needed modules

# echo "modprobe raid1" > /etc/sysconfig/modules/raid.modules

you can add lines for another raid level (raid0 or raid10 for example)

 

2. Make this file executable

# chmod +x /etc/sysconfig/modules/raid.modules

 

3. Reboot.

 

PS: I do not know will this changes survive after installing patches

 

 

I will test this solution and will write here.

 

Many thank's Ruslan!



edmarcos souza Members

edmarcos souza
  • 26 posts

Posted 27 January 2015 - 01:25 AM

After spending yesterday and part of today I think I got the final solution to the soft raid on XenServer 6.5.
And I am providing a script for the same.
 
Brazil a country of all ...

 

http://www.guanabara.info/wp-content/uploads/2010/05/Brasil-Linux-Tux-Pinguim.jpg


Best Answer Helpful Answer

Maycon Santos Members

Maycon Santos
  • 1 posts

Posted 27 January 2015 - 02:47 PM

I will test this solution and will write here.

 

Many thank's Ruslan!

Hi Artem,

 

Did you have any success?  I tested the same fix but in my case the arrays were lost after reboot, even after add it to mdadm.conf.



James Cannon Citrix Employees

James Cannon
  • 4,402 posts

Posted 27 January 2015 - 06:33 PM

It would be good to test the software RAID by removing a drive.



Artem Issayev Members

Artem Issayev
  • 12 posts

Posted 28 January 2015 - 03:21 AM

Ok guys,

I just finish some fight with s-RAID setup... :angry:

The solution that wrote Ruslan is work, but only for  "mdadm --create..." function. But as Maycon say, after reboot lost the arrays. Maybe I'm doing something wrong  :)  I'm not a Xen guru. :rolleyes:

But guys, you need to check the mad script from Brasil  :D published by Edmarcos Souza. It work's great for me!

 

Today i want to do some tests, will try to removing the drive and later answer here.

 

Gracias Edmarcos!



Artem Issayev Members

Artem Issayev
  • 12 posts

Posted 29 January 2015 - 03:07 AM

But guys, you need to check the mad script from Brasil  :D published by Edmarcos Souza. It work's great for me!

 

Today i want to do some tests, will try to removing the drive and later answer here.

 

Gracias Edmarcos!

 

Ok guys,

What i've check.....

  • I remove hdd (sdb) and start the server - it start normally.
  • I poweroff and install newest and virgin hdd as sdb.
  • I start script (part3) and connect new sdb to raid arrays sucessfully.
  • Syncronization progress started.

For me the script from Edmarcos is the solution! Thanks to everyone!  :rolleyes:

 

After sync will complete, i will try to reboot and start from second drive and will write here.

 

Update: Syncronization is done. Reboot the server and start from second hdd. RAID active, all works fine!


Edited by Artem Issayev, 29 January 2015 - 09:10 AM.


edmarcos souza Members
  • #10

edmarcos souza
  • 26 posts

Posted 29 January 2015 - 05:15 PM

If the procedure has been doubts with the scrip is as follows:
install xen in hd sda
run the script with the parameter is part1 select the sda sdb as the source and the destination.
After complete disconnect the xen and reverse the leads boot sata by sdb (which will turn sda because the cables were reversed)
run the script again but now with the part2 and display the disk vair be synchronized (SDB who was previously sda). and ready, wait for the sync disks.

The part3 is for the case of exchange of a damaged disc.

 

Caso tenha ficado duvidas o procedimento com o scrip é o seguinte:
instale o xen no hd sda
rode o script com o paramentro part1 selecione o sda como origem e sdb como destino.
Apos concluir desligue o xen e inverta os cabos sata de boot pelo sdb ( que vai virar sda porque os cabos foram invertidos)
execute o script novamente mas agora com o part2 e indique o disco que vair ser sincronizado (sdb que era sda anteriormente). e pronto, aguarde os discos sincronizarem.

A part3 é pra caso de troca de algum disco danificado.
 



widya media Members
  • #11

widya media
  • 2 posts

Posted 01 March 2015 - 04:24 AM

the url for downloading the script can not be accessed from here :(

 

can anyone submit the script again ?

 

many thanks



Artem Issayev Members
  • #12

Artem Issayev
  • 12 posts

Posted 02 March 2015 - 09:58 AM



the url for downloading the script can not be accessed from here :(

 

can anyone submit the script again ?

 

many thanks

 

If edmarcos souza don't mind here is the link to script:

raid.7z Password for download: citrix


Edited by Artem Issayev, 02 March 2015 - 09:58 AM.


widya media Members
  • #13

widya media
  • 2 posts

Posted 03 March 2015 - 09:29 AM

 

If edmarcos souza don't mind here is the link to script:

raid.7z Password for download: citrix

 

cool :) i will try the script at week end... and will report it soon, hope it working in my server and hope it usefull for other

 

many thanks



Marcelo Pires Members
  • #14

Marcelo Pires
  • 1 posts

Posted 18 June 2015 - 02:25 PM

Ok guys,

What i've check.....

  • I remove hdd (sdb) and start the server - it start normally.
  • I poweroff and install newest and virgin hdd as sdb.
  • I start script (part3) and connect new sdb to raid arrays sucessfully.
  • Syncronization progress started.

For me the script from Edmarcos is the solution! Thanks to everyone!  :rolleyes:

 

After sync will complete, i will try to reboot and start from second drive and will write here.

 

Update: Syncronization is done. Reboot the server and start from second hdd. RAID active, all works fine!

I proceeded as stated, then i created a file on the first hd (sda), but when booting from the second hd, this file is not there.



Steven Schoch Members
  • #15

Steven Schoch
  • 12 posts

Posted 26 June 2015 - 07:27 PM

After spending yesterday and part of today I think I got the final solution to the soft raid on XenServer 6.5.
And I am providing a script for the same.
 

 

Your script worked for me! (I first had to erase /dev/sdb using fdisk.) Now I'm going to see if I can apply SP1.



Jean-Marc Frappier Members
  • #16

Jean-Marc Frappier
  • 2 posts

Posted 31 July 2015 - 01:39 PM

Tried all links to the script and they don't work.

Please post again as i really need this to work.

Thanks



edmarcos souza Members
  • #17

edmarcos souza
  • 26 posts

Posted 01 September 2015 - 01:08 AM

Fixed link



foresthus Members
  • #18

Gero Waldhausen
  • 2 posts

Posted 28 January 2016 - 11:07 AM

 

After spending yesterday and part of today I think I got the final solution to the soft raid on XenServer 6.5.
And I am providing a script for the same.
 
Brazil a country of all ...

 

http://www.guanabara.info/wp-content/uploads/2010/05/Brasil-Linux-Tux-Pinguim.jpg

 

The tool works fine. There must be still a problem with /dev/md2.

If you look at the mdstat you will see that the md2 is degraded.

 

[root@myserverathome ~]# cat /proc/mdstat
Personalities : [raid1]
md2 : active raid1 sdb3[1]
      147770048 blocks super 1.2 [2/1] [_U]

 

Is there a simple way to add /dev/sda3? The is no superblock. :(

 

mdadm: /dev/sdb3 has wrong uuid.

 

Anyone an idea?