devstack stein 安装后创建不了卷

2015-10-15 14:02:37.786 TRACE cinder.volume.manager Command: sudo cinder-rootwrap /etc/cinder/rootwrap.conf env LC_ALL=C vgs --noheadings -o name stack-volumes-lvmdriver-1
2015-10-15 14:02:37.786 TRACE cinder.volume.manager Exit code: 5
2015-10-15 14:02:37.786 TRACE cinder.volume.manager Stdout: u‘‘
2015-10-15 14:02:37.786 TRACE cinder.volume.manager Stderr: u‘  Volume group "stack-volumes-lvmdriver-1" not found

 

解决方法:

原来是VG在devstack安装中没有创建,接着手工创建vg:
在devstack脚本中看到默认vg的创建过程
lib/lvm
function _create_lvm_volume_group

$ truncate -s 15G vg_file
yuntong@yuntong-ThinkStation:/opt/stack/data/cinder$ sudo losetup -f --show vg_file
/dev/loop0


yuntong@yuntong-ThinkStation:/opt/stack/data/cinder$ sudo vgcreate stack-volumes-lvmdriver-1 /dev/loop0
  No physical volume label read from /dev/loop0
  Physical volume "/dev/loop0" successfully created
  Volume group "stack-volumes-lvmdriver-1" successfully created

重启cinder-volume就可以创建了。

systemctl restart devstack@c-vol

 

 

说明:

TRUNCATE(1)                                                                           User Commands                                                                           TRUNCATE(1)

NAME
       truncate - shrink or extend the size of a file to the specified size

SYNOPSIS
       truncate OPTION... FILE...

DESCRIPTION
       Shrink or extend the size of each FILE to the specified size

       A FILE argument that does not exist is created.

       If a FILE is larger than the specified size, the extra data is lost.  If a FILE is shorter, it is extended and the extended part (hole) reads as zero bytes.

       Mandatory arguments to long options are mandatory for short options too.

       -c, --no-create
              do not create any files

       -o, --io-blocks
              treat SIZE as number of IO blocks instead of bytes

       -r, --reference=RFILE
              base size on RFILE

       -s, --size=SIZE
              set or adjust the file size by SIZE bytes

       --help display this help and exit

       --version
              output version information and exit

       The SIZE argument is an integer and optional unit (example: 10K is 10*1024).  Units are K,M,G,T,P,E,Z,Y (powers of 1024) or KB,MB,... (powers of 1000).

       SIZE  may  also  be prefixed by one of the following modifying characters: '+' extend by, '-' reduce by, '<' at most, '>' at least, '/' round down to multiple of, '%' round up to
       multiple of.

--------------------------------------------

LOSETUP(8)                                                                        System Administration                                                                        LOSETUP(8)

NAME
       losetup - set up and control loop devices

SYNOPSIS
       Get info:

            losetup [loopdev]

            losetup -l [-a]

            losetup -j file [-o offset]

       Detach a loop device:

            losetup -d loopdev...

       Detach all associated loop devices:

            losetup -D

       Set up a loop device:

            losetup [-o offset] [--sizelimit size] [--sector-size size]
                    [-Pr] [--show] -f|loopdev file

       Resize a loop device:

            losetup -c loopdev

DESCRIPTION
       losetup  is used to associate loop devices with regular files or block devices, to detach loop devices, and to query the status of a loop device.  If only the loopdev argument is
       given, the status of the corresponding loop device is shown.  If no option is given, all loop devices are shown.

       Note that the old output format (i.e., losetup -a) with comma-delimited strings is deprecated in favour of the --list output format.

       It's possible to create more independent loop devices for the same backing file.  This setup may be dangerous, can cause data loss, corruption and  overwrites.   Use  --nooverlap
       with --find during setup to avoid this problem.


posted @ 2019-08-12 15:49  kissrule  阅读(347)  评论(0编辑  收藏  举报