You are not logged in.

#1 2015-11-22 11:17:02

folatt
Member
Registered: 2015-08-01
Posts: 96

[Solved] xl create problem with Arch Linux, Xen, DomU LVM

This is still my first time setting up a DomU. With Dom0 being Arch Linux and DomU as well.
I recently figured out that I would need an LVM for my setup as I want at least two partitions (root + swap).

My current problem is that I don't know what my LVM setup should be and this what I have so far:

$ sudo xl create /etc/xen/ArkOS-dev_PV.cfg   

Parsing config from /etc/xen/ArkOS-dev_PV.cfg
libxl: error: libxl_device.c:283:libxl__device_disk_set_backend: Disk vdev=sda1 failed to stat: vm_volumes/root.ArkOS_Dev: No such file or directory
libxl: info: libxl.c:1691:devices_destroy_cb: forked pid 529 for destroy of domain 3

My DomU boot configuration file :

$ cat /etc/xen/ArkOS-dev_PV.cfg

name = 'ArkOS_Dev'
kernel = "/mnt/arch/boot/x86_64/vmlinuz"
ramdisk = "/mnt/arch/boot/x86_64/archiso.img"
extra = "archisobasedir=arch archisolabel=ARCH_201511"
memory = 512
disk = [ "phy:vm_volumes/root.ArkOS_Dev,sda1,w",
         "phy:vm_volumes/swap.ArkOS_Dev,sda2,w", 
         "file:/home/xen/ISO/archlinux-2015.11.01-dual.iso,xvdb:cdrom,r" 
       ]
vif = [ 'mac=00:16:3e:49:2b:a1,bridge=xenbr0' ]
root = "/dev/sda1 ro"

$ lsblk -f

NAME                          FSTYPE      LABEL UUID                                   MOUNTPOINT
sda                                                                                    
|-sda1                        vfat              FF2C-B8A3                              /boot
|-sda2                        btrfs             b3f4f40f-a8a1-4438-a187-dc02f2104340   /
|-sda3                        LVM2_member       HiIS0n-cJ24-mdr5-aUVc-sacn-Hpvx-xM2qd2 
| |-vm_volumes-root.ArkOS_Dev                                                          
| `-vm_volumes-swap.ArkOS_Dev                                                          
`-sda4                        swap              f90e6e95-5f00-4138-aa76-13feb4bce985   [SWAP]

sudo lvdisplay

  --- Logical volume ---
  LV Path                /dev/vm_volumes/root.ArkOS_Dev
  LV Name                root.ArkOS_Dev
  VG Name                vm_volumes
  LV UUID                tRjJex-aNJg-8gJL-16lD-c1uo-cgfI-1qQEF1
  LV Write Access        read/write
  LV Creation host, time hypervisor, 2015-11-21 19:33:14 +0100
  LV Status              available
  # open                 0
  LV Size                87.29 GiB
  Current LE             22346
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:0
   
  --- Logical volume ---
  LV Path                /dev/vm_volumes/swap.ArkOS_Dev
  LV Name                swap.ArkOS_Dev
  VG Name                vm_volumes
  LV UUID                t2OeL1-DDvf-vZLP-dxmh-NDbb-tcqb-zqNfGZ
  LV Write Access        read/write
  LV Creation host, time hypervisor, 2015-11-21 19:33:21 +0100
  LV Status              available
  # open                 0
  LV Size                2.00 GiB
  Current LE             512
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:1

Last edited by folatt (2015-11-25 19:22:59)

Offline

#2 2015-11-25 00:04:52

BuLLeKeUp
Member
From: France
Registered: 2015-11-19
Posts: 4
Website

Re: [Solved] xl create problem with Arch Linux, Xen, DomU LVM

It seems that disks paths you use are incomplete.

Plus, I don't know if you can pass lvm volumes as partitions rather than disks, and it seems pretty difficult to do, cause there will be no /dev/sda disk block device (or sda1 becomes a complete disk and so does sda2 ? )

If you just have the problem of root and swap partitions, you can pass a single lvm logical volume, say /dev/vm_volumes/ArkOS_Disk, as disk /dev/sda and do partitioning for root and swap inside the VM (the logical volume you pass is seen like a complete hard drive by the VM). That's the standard way to go if you want only one logical volume. But maybe you want two logical volumes for another reason ? (swap sharing between non-concurrent VMs ?) Then I think you have to use two different disks in the VM (sda and sdb, or xvda and xvdb if sd format doesn't work), for each logical volume.

Try with following disk section (according to information you provide)

disk=[ 'format=raw, vdev=sda, access=rw, target=/dev/vm_volumes/root.ArkOS_Dev', 
       'format=raw, vdev=sdb, access=rw, target=/dev/vm_volumes/swap.ArkOS_Dev' ,
       'format=raw, vdev=xvdc, access=ro, devtype=cdrom, target=/home/xen/ISO/archlinux-2015.11.01-dual.iso']

I use complete syntax in the disk section as I find it improves readability (personal preference, do as you wish)
See official Xen disk doc for more informations wink


PGP Key ID: D941F782
Fingerprint: 5ACE 0019 4F3C 749E 3BC6  5C09 B10C 4D5A D941 F782
Public key: https://www.bullekeup.net/pgp/

Offline

#3 2015-11-25 19:22:21

folatt
Member
Registered: 2015-08-01
Posts: 96

Re: [Solved] xl create problem with Arch Linux, Xen, DomU LVM

Thanks. Well I'm new to both xen and lvm volumes. Even partitions are still kind of new to me, so it confused me.

Offline

#4 2015-11-29 19:41:59

BuLLeKeUp
Member
From: France
Registered: 2015-11-19
Posts: 4
Website

Re: [Solved] xl create problem with Arch Linux, Xen, DomU LVM

You're welcome.

That's why I tried to explain the best way, and be as clear as I can, so you actually can understand how it works a bit better than before ^^


PGP Key ID: D941F782
Fingerprint: 5ACE 0019 4F3C 749E 3BC6  5C09 B10C 4D5A D941 F782
Public key: https://www.bullekeup.net/pgp/

Offline

Board footer

Powered by FluxBB