Mailinglist Archive: opensuse-buildservice (124 mails)

< Previous Next >
Re: [opensuse-buildservice] Confused about LVM and bootstrap process
On Donnerstag, 24. November 2016, 11:16:33 CET wrote Greg Ward:
Hi,

I'm trying to setup a little toy OBS to learn how it works. I'm using
KVM on Ubuntu 16.04, following the directions at

http://openbuildservice.org/download/other/

A couple of things are unclear on that page: 1) exactly how to create
the LVM volume group and logical volume, 2) whether the "OBS" VG is
required or merely desirable, and 3) how to tell if OBS is using those
LVM volumes.

For #1, I google'd and read some blog posts and learned about creating a
big empty file, running "losetup" on it, then using pvcreate, vgcreate,
and lvcreate. Result: a 10 GB file on the host system, accessible via
/dev/loop0, containing a single volume group called "OBS". 4 GB of that
volume group is allocated to a logical volume called "server". The other
6 GB is unallocated. I can see these *on the host system* with vgdisplay
and lvdisplay.

(Yes, I know 10 GB is almost certainly not enough. This is a toy OBS,
just for learning. Once I've successfully built a couple of packages,
I'll probably throw it away.)

Then, before booting the OBS VM for the first time, I attached
/dev/loop0 to the VM as a second hard disk.

And it seems to have worked! Once the VM is booted, vgdisplay and
lvdisplay show me the LVS stuff I created on the host system:

obstest:~ # vgdisplay
--- Volume group ---
VG Name OBS
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 4
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 10.00 GiB
PE Size 4.00 MiB
Total PE 2559
Alloc PE / Size 1024 / 4.00 GiB
Free PE / Size 1535 / 6.00 GiB
VG UUID 8L9QSW-lEnD-f1rN-Qbxc-yav7-U0Sv-EitQn5

obstest:~ # lvdisplay
--- Logical volume ---
LV Path /dev/OBS/server
LV Name server
VG Name OBS
LV UUID g6N3zs-MbtP-nTZY-tK0V-EGvE-Vk3S-kEYrRb
LV Write Access read/write
LV Creation host, time queequeg, 2016-11-22 23:07:55 +0000
LV Status available
# open 0
LV Size 4.00 GiB
Current LE 1024
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 1024
Block device 254:0

So, I *believe* I have satisfied the LVS conditions explained on
http://openbuildservice.org/download/other/.

After running /usr/lib/obs/server/setup-appliance.sh, I was able to
access the OBS web interface from my host system. Awesome! But there is
no indication that OBS has done anything with my LVM setup. Was that all
a waste of time? Or did I do something wrong?

/dev/OBS/server is used for the data storage of the server when you use
the appliance setup. This should become visible, when you check your mount
points on your system, it should be mounted to /srv/obs.

This makes sense, because you can replace the entire appliance (the root file
system)
for example to update your server. Or to move it to some other location.

The new appliance will check on boot, mount it at the same place and may
run some updates (eg database migrations) and you won't loose any data.

--

Adrian Schroeter
email: adrian@xxxxxxx

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284
(AG Nürnberg)

Maxfeldstraße 5
90409 Nürnberg
Germany


--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-buildservice+owner@xxxxxxxxxxxx

< Previous Next >
References