xl 使用 Arch Linux、Xen、DomU LVM 创建问题

xl 使用 Arch Linux、Xen、DomU LVM 创建问题

这还是我第一次建立DomU。 Dom0 是 Arch Linux,DomU 也是如此。我最近发现我的设置需要一个 LVM,因为我至少需要两个分区(根分区 + 交换分区)。

我当前的问题是我不知道我的 LVM 设置应该是什么,到目前为止我的设置是这样的:

$ 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

我的 DomU 启动配置文件:

$ 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]

须藤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

答案1

解决了这个:

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 = 2048
vcpus = 3
disk = [ "format=raw, vdev=xvda, access=rw, target=/dev/vm_volumes/root.ArkOS_Dev",
         "format=raw, vdev=xvdb, 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"
       ]
vif = [ 'mac=00:16:3e:49:2b:a1,bridge=xenbr0' ]
root = "/dev/xvda rw"

然后安装 DomU 后:

name = 'ArkOS_Dev'
bootloader = "pygrub"
memory = 2048
vcpus = 3
disk = [ "format=raw, vdev=xvda, access=rw, target=/dev/vm_volumes/root.ArkOS_Dev",
         "format=raw, vdev=xvdb, access=rw, target=/dev/vm_volumes/swap.ArkOS_Dev"
       ]
vif = [ 'mac=00:16:3e:49:2b:a1,bridge=xenbr0' ]
root = "/dev/xvda rw"

相关内容