[SOLVED] How To Setup A KVM Guest So It Uses Software RAID-1
Linux - Virtualization and CloudThis forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How To Setup A KVM Guest So It Uses Software RAID-1
I use virt-install in a shell script to build my virtual machines. I want to know how to define multiple qcow2 files so that I can define software raid-1 during installation.
Any Ideas?
Gene
You can use the manual to see how to add an additional virtual disk to the VM. When you then install the OS, you can define raid like it is done when installing onto barebones.
If however, your virtual host is already running raid, it would be pointless having raid running in a raid environment.
Speaking of which, i recommend you let the vm host do the raid and just do a plain install. That way, the base system takes care of the mirroring. Ibwould imagine doing that on qcow2 would be a really big performance hit.
If you created a number of virtual hard drives and if your client has them attached, you could construct a software raid. If you don't want to mess with the client's host drive then just add in two more virtual hard drives to the client and use the clients mdadm tools.
My host is running great using CentOS 6.8 and software RAID-1. I'll not mess with that.
Here's what I want to determine:
When I installed CentOS 6 on the host I implemented software raid-1 during the installation by doing by partition.
When I had a hard drive failure on /dev/sda the machine would not boot and I remembered that during the install the MBR went on /dev/sda - I had to reinstall
So I want to test if:
I raid-1 /dev/sda and /dev/sdb and call it /dev/md0_d1
When I get to the installation point where I'm installing the MBR and I install it to /dev/md0_d1
And later on /dev/sda dies will my system still boot with a degraded raid-1?
Hence, these questions.
I've added virtual disk drives to guests running on VMware, but the OS is already installed.
I want to have 2 virtual disk drives available before I install the OS
When I had a hard drive failure on /dev/sda the machine would not boot and I remembered that during the install the MBR went on /dev/sda - I had to reinstall
You should have (manually) installed to the MBR on /dev/sdb as well. This is well documented for RAID1 /boot.
Quote:
So I want to test if:
I raid-1 /dev/sda and /dev/sdb and call it /dev/md0_d1
When I get to the installation point where I'm installing the MBR and I install it to /dev/md0_d1
And later on /dev/sda dies will my system still boot with a degraded raid-1?
Nope. I doubt anaconda will allow it anyway. If you use the entire devices, there will be no MBR - it will be over-written. If you later run grub-install (or setup) you will over-write the metadata for the mdadm device. Nothing good can come from any of that.
I'm not a expert on this stuff, but isn't that what you do when running RAID-10 (putting entire disks together as raid-0 the taking 2 raid-0 devices making them raid-1)? What I want to do is a software equiv of a hardware raid environment (the MBR is installed on a /dev/sda that is really 2 physical disks). Is the electronics on the hardware raid controller managing the MBR?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.