4

I installed XenServer 6.0 on a machine with 2 drives (80GB SSD and 1TB SATA). My goal is to have some space for local storage where I can put ISO (since it will be very difficult to access the box physically, and I would prefer to install VMs from ISOs and not from CDs).

However, no matter what I specify for LVM, the only filesystem on sda is 4G (and only 2GB is available). XenCenter shows me plenty of disk space available for VMs; but that doesn't help me with ISOs.

Is it possible to increase local storage? I haven't started building VMs yet - so now is ideal time to partition the disk the way it should be. But parted is not installed - and I suspect for a reason.

Here is the output from pvdisplay:

[root@xenserver ~]# pvdisplay
--- Physical volume ---
PV Name               /dev/sdb
VG Name               VG_XenStorage-a7bbe7ea-f205-5f25-4ef8-daec4e08bcb2
PV Size               931.51 GB / not usable 6.41 MB
Allocatable           yes
PE Size (KByte)       4096
Total PE              238464
Free PE               238463
Allocated PE          1
PV UUID               yqrKQi-l8mD-k3mo-PxEs-M0bK-7xx3-17nnzE

"/dev/sda3" is a new physical volume of "66.53 GB"
--- NEW Physical volume ---
PV Name               /dev/sda3
VG Name
PV Size               66.53 GB
Allocatable           NO
PE Size (KByte)       0
Total PE              0
Free PE               0
Allocated PE          0
PV UUID               HlXvAo-f6gw-eqMz-5Y1d-YzYi-19tK-xZTWoE

So, the real question is, how can I make use of 66GB on /dev/sda3 without breaking anything in XenServer?

Felix
  • 533
  • 4
  • 10
  • 23

2 Answers2

2

From archy.net:

Type : fdisk -l

you’ll see the list of all volumes and hard drives, then :

Type : pvcreate /dev/sdb

sdb is my new volume

and then to configure it as a local storage :

Type : xe sr-create type=lvm content-type=user device-config:device=/dev/disk/by-id/scsi-SATA_ST3320620AS_5QF7QZZL name-label=”LOCAL SR”

scsi-SATA_ST3320620AS_5QF7QZZL is the name of my volume, you’ll have to change this value with your own, and name-label is the name you want to give to your local storage.

and this is it !

Remark : If your XenServer is a pool, you need to put it off, follow above steps and put back the XenServer in your pool.

Lucas Kauffman
  • 16,818
  • 9
  • 57
  • 92
  • Thanks. yes, I saw that... unfortunately, it didn't work (pvcreate gave an error). Interestingly, I found the answer half hour after I posted the question. I'll put it as a separate answer, to simplify reading. – Felix Mar 11 '12 at 00:27
  • ah nice, glad you found out :D – Lucas Kauffman Mar 11 '12 at 08:59
2

Apparently, when XenServer gets installed, physical volume get created, but nothing else. So, the steps to get are the following (see more detailed explanation here.

vgcreate VGLocal /dev/sda3 
lvcreate -n -L 66GB LVLocal VGLocal
mke2fs -j /dev/VGLocal/LVLocal
mkdir /var/opt/xen/iso_import/
mount /dev/VGLocal/LVLocal /var/opt/xen/iso_import/

Then configure as local storage...

By the way, configuring local storage with xe sr-create didn't work out, either. What worked was xe-mount-iso-sr /var/opt/xen/iso_import/ -o bind

Felix
  • 533
  • 4
  • 10
  • 23