Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Several online documents on this subject talk about creating an SR with the option type=lvm but trying these:

# xe sr-create type=lvm device-config:device=/dev/server/sr_guest1 
      name-label=sr1

The SR could not be connected because the driver was not recognised.
driver: lvm

It seems I can't, tabcompletion attemps tell me that these are the ones I can use:

root@server:~# xe sr-probe type=[TAB]
dummy   ext     file    iso     nfs     

And indeed lvm isn't among them. I searched for hours trying to find similar problems but nothing helpful.

Versions:

root@server:~# cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.1 LTS"

root@server:~# dpkg --list  | egrep 'xen|xapi|xcp'
ii  libxen-4.1                       4.1.2-2ubuntu2.4                 
ii  libxenstore3.0                   4.1.2-2ubuntu2.4                
ii  python-xenapi                    1.3.2-5ubuntu0.1
ii  xen-hypervisor-4.1-amd64         4.1.2-2ubuntu2.4
ii  xen-utils-4.1                    4.1.2-2ubuntu2.4
ii  xen-utils-common                 4.1.2-1ubuntu1
ii  xenstore-utils                   4.1.2-2ubuntu2.4
ii  apt-xapian-index             0.44ubuntu5
ii  libxapian22                  1.2.8-1
ii  python-xapian                    1.2.8-1
ii  xcp-eliloader                    0.1-4
ii  xcp-fe                           0.5.2-3
ii  xcp-guest-templates          0.1-3
ii  xcp-networkd                     1.3.2-5ubuntu0.1
ii  xcp-squeezed                     1.3.2-5ubuntu0.1
ii  xcp-storage-managers             0.1.1-2ubuntu1
ii  xcp-v6d                          1.3.2-5ubuntu0.1
ii  xcp-vncterm                  0.1-2
ii  xcp-xapi                     1.3.2-5ubuntu0.1
ii  xcp-xe                           1.3.2-5ubuntu0.1

Is anyone willing to explain the reason to me? Stating the obvious: I'm using LVM from the initial install. I want to install VMs on their own logical volumes, not images, so I think I really need that option.

So, is there a way to add LVM support to it?

update:

Maybe this might be a clue, don't know. Is it just that I don't have citrix...

share|improve this question
1  
I am missing "phy" as type. This should be the generic type for handling block-devices (partition, physical, disk, LVM, DRBD - almost all the same). –  Nils Jan 4 '13 at 21:31
    
Nils, do you mean, in that list you don't see phy ? Or are you saying you have an almost similar issue? Not sure here. TX –  Glenn Plas Jan 5 '13 at 21:10
    
I am using XEN based on the older 3 and 4 versions (with the old xm cli) - with SLES 10/11 as Dom0. There I have basically tapio, drbd, phy and file as possible configuration directives for accessing virtual disks. If I translate that to your XE I only see high-level access-methods. –  Nils Jan 5 '13 at 22:06

3 Answers 3

Use type=lvhd instead of type=lvm. I think that is what you are searching for. As far as I know this is the default in newer versions of xenserver.

share|improve this answer
    
I would if it was in the option list, the choice is limited to it(see post). tx. –  Glenn Plas Jan 10 '13 at 9:34
1  
The OP is using XCP on Ubuntu via Project Kronos, not Citrix XenServer. The Kronos Debian packages don't include the lvm or lvhd SR drivers. –  Sam Hanes Oct 10 '13 at 8:09
up vote 2 down vote accepted

Apparently the driver python script just isn't included in the stock release of xcp-xapi. I've figured out a way to get the lvm driver to be available for selection. This is what I did:

I downloaded the xcp-xapi source. I looked for the LVM* drivers and copied it to the running host and set a symbolic link to it like this:

cp /usr/local/src/xcp-storage-managers-0.1.1/drivers/LVMSR.py /usr/lib/xcp/sm/
cd /usr/lib/xcp/sm/
ln -s LVMSR.py LVMSR

After restarting

/etc/init.d/xcp-xapi restart

I could tab-complete the driver(that's a start)

root@server:~# xe sr-list type=
dummy   ext     file    iso     lvm     nfs

Then against all odds I managed to find 2 GB:

lvcreate --size 2G --name sr_test server
   Logical volume "sr_test" created

And then

root@server:~# xe sr-create type=lvm \
    device-config:device=/dev/server/sr_test name-label=srt

Which gives me

Error code: SR_BACKEND_FAILURE_53
Error parameters: , Logical Volume unmount/deactivate error [opterr=errno is 3], 

So not there yet.

A bit of searching reveals this very interesting post to me, apparantly the Kronos debian folks did this on purpose (but failed to mention the fact that they did not include LVM due to it being not tested enough ...)

So I ended up doing this:

root@server:/usr/lib/xcp/sm# locate  lvutil.pyc
/usr/lib/xcp/sm/lvutil.pyc

Edit this file, at line 302 you should see:

cmd = [CMD_VGCHANGE, "-an", "--master", vgname]

Remove the master option from this line. At line 344, in setActiveVG there is another one.

cmd = [CMD_VGCHANGE, "-a" + val, "--master", path]

the vgchange in this ubuntu release doesn't support this option. The reason why is in the link mentioned. Make it:

cmd = [CMD_VGCHANGE, "-an", vgname]

and

cmd = [CMD_VGCHANGE, "-a" + val, path]

for both lines. All the sudden this works (at first sight since I get UUID):

root@server:~# xe sr-create type=lvm  \
    device-config:device=/dev/server/sr_test name-label=srt
1b916212-bb83-f958-2c76-fa1f9829e6af

Hope this helps someone. I do get this in the logs:

 [20130124T13:42:47.877Z|debug|server|102|scan one D:ba6210351c61|xapi]
 SR 1b916212-bb83-f958-2c76-fa1f9829e6af (srt) is not shared or is being
 plugged to a slave - not handling metadata VDIs at this point.

Since this is not shared nor it is a slave, I think I'm ok but I don't like it saying it's not handling metadata , although it says 'at this point', which I interpret as no need for now. Input welcome.

share|improve this answer

Hmm, I would just use XCP bare metal iso install as the Dom0. Entire OS install of ubuntu is overkill. Just my opinion. Not an answer but an observation and bare metal just works out of the box with LVM.

share|improve this answer
1  
Hi and Welcome to Unix & Linux! Please read the How to Answer a Question Guide. This site is a Q&A site not a forum. –  slm Apr 8 '13 at 16:52
    
besides @sim's remark, we're not talking about LVM but about LVM + VHD's (thick provisioned). There are several LVM xcp drivers depending on the targeted backend. –  Glenn Plas Apr 22 '13 at 19:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.