LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This 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


Reply
  Search this Thread
Old 02-26-2017, 06:49 PM   #1
etpoole60
Member
 
Registered: Jan 2008
Posts: 111

Rep: Reputation: 0
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
 
Old 02-26-2017, 08:40 PM   #2
ericson007
Member
 
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 735

Rep: Reputation: 154Reputation: 154
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.
 
Old 02-27-2017, 11:27 AM   #3
etpoole60
Member
 
Registered: Jan 2008
Posts: 111

Original Poster
Rep: Reputation: 0
I want to try and raid-1 the entire disk as opposed to raid-1 by partition ( does this mean I'll partition the MD device??).
TIA
Gene
 
Old 02-27-2017, 02:40 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626
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.

Don't mix up host and client in this.
 
Old 02-28-2017, 04:31 PM   #5
etpoole60
Member
 
Registered: Jan 2008
Posts: 111

Original Poster
Rep: Reputation: 0
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

TIA
Gene
 
Old 02-28-2017, 05:11 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by etpoole60 View Post
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.
 
Old 03-02-2017, 05:47 PM   #7
etpoole6465
LQ Newbie
 
Registered: Jun 2014
Location: Northwest Metro-Atlanta - Woodstock
Distribution: CentOS 6
Posts: 16

Rep: Reputation: Disabled
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?

Am I overthinking this stuff?

TIA
Gene
 
Old 03-13-2017, 06:36 PM   #8
etpoole60
Member
 
Registered: Jan 2008
Posts: 111

Original Poster
Rep: Reputation: 0
I've marked this as solved, but I am still working on it. 'Real' work has raised it's ugly head and it is taking all of my time.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Kernel-based Virtual Machine (KVM): Switching from KVM guest to host (e.g. Linux Mint) & maximize guest screen fanoflq Linux - Newbie 2 07-13-2016 06:10 PM
Presenting logical volume from host to KVM guest. Partition within guest? batfastad Linux - Server 2 07-27-2015 03:53 PM
Network setup KVM guest to use eth0 as is. on CentOS Air-Global Linux - Virtualization and Cloud 7 02-28-2013 06:33 AM
KVM with Ubuntu guest - guest crashes when some apps are 'full screened' TonyRogers Linux - Virtualization and Cloud 0 05-15-2011 12:18 PM
KVM Hypervisor and Guest OS setup? Help! sheepy Linux - Server 3 10-15-2009 08:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 08:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration