XenServer之XenServer 7 上创建本地ISO库

今天在XenServer7 上想创建个ISO库,但是发现出现一个之前没有过的问题,症状如下

[[email protected] ~]# lvcreate -L 20G -n local_iso `vgs|awk 'NR==2{print $1}'`
  lvcreate -L 20G -n local_iso VG_XenStorage-8e812398-6d55-b06a-2907-ac95c4c12533: Command not permitted while global/metadata_read_only is set.

居然提示全局只读 命令不允许。经过gg的查找最后在思杰官方找到了解决方法

[[email protected] ~]# pvs
  PV         VG                                                 Fmt  Attr PSize PFree
  /dev/sda3  VG_XenStorage-8e812398-6d55-b06a-2907-ac95c4c12533 lvm2 a--  7.24t 7.24t
[[email protected] ~]# vgs
  VG                                                 #PV #LV #SN Attr   VSize VFree
  VG_XenStorage-8e812398-6d55-b06a-2907-ac95c4c12533   1   1   0 wz--n- 7.24t 7.24t
[[email protected] ~]# lvs
  LV   VG                                                 Attr       LSize Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  MGT  VG_XenStorage-8e812398-6d55-b06a-2907-ac95c4c12533 -wi-a----- 4.00m

这是一台刚装好系统的XenServer 7,

[[email protected] ~]# lvcreate -L 20G -n local_iso `vgs|awk 'NR==2{print $1}'`  --config global{metadata_read_only=0}
  Logical volume "local_iso" created.
[[email protected] ~]# mkfs.ext4 /dev/`vgs|awk 'NR==2{print $1}'`/local_iso
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
1310720 inodes, 5242880 blocks
262144 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2153775104
160 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

[[email protected] ~]# echo "$(blkid /dev/`vgs|awk 'NR==2{print $1}'`/local_iso|awk '{gsub(/"/,"");print $2}')  /iso_storage  ext4  defaults    0 0" >> /etc/fstab && { [ -d /iso_storage ] || mkdir -p /iso_storage; } && mount -a && clear && df -hP
Filesystem                                                         Size  Used Avail Use% Mounted on
/dev/sda1                                                           18G  1.8G   16G  11% /
devtmpfs                                                           2.0G     0  2.0G   0% /dev
tmpfs                                                              2.0G   84K  2.0G   1% /dev/shm
tmpfs                                                              2.0G  1.6M  2.0G   1% /run
tmpfs                                                              2.0G     0  2.0G   0% /sys/fs/cgroup
xenstore                                                           2.0G     0  2.0G   0% /var/lib/xenstored
/dev/loop0                                                          55M   55M     0 100% /var/xen/xc-install
/dev/sda4                                                          512M  2.0M  510M   1% /boot/efi
/dev/sda5                                                          4.0G  140M  3.7G   4% /var/log
tmpfs                                                              393M     0  393M   0% /run/user/0
/dev/VG_XenStorage-8e812398-6d55-b06a-2907-ac95c4c12533/local_iso   20G   45M   19G   1% /iso_storage
[[email protected] ~]# xe sr-create name-label=iso_storage type=iso device-config:location=/iso_storage device-config:legacy_mode=true content-type=iso
xe-mount-iso-sr /iso_storage

XenServer之XenServer 7 上创建本地ISO库

[[email protected] ~]# cd /iso_storage/
[[email protected] iso_storage]# wget http://buildlogs.centos.org/rolling/7/isos/x86_64/CentOS-7-x86_64-Everything.iso

XenServer之XenServer 7 上创建本地ISO库

  • 本文由 发表于 2016年7月24日03:29:50
  • 除非特殊声明,本站文章均为原创,转载请务必保留本文链接


匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: