First, currently using the Losetup emulated hard drive to create a VG, as follows:
Mkdidr-p/var/lib/cinder
DD If=/dev/zero of=/var/lib/cinder/cinder-volumes bs=1m count=10000
Losetup/dev/loop2/var/lib/cinder/cinder-volumes
Pvcreate/dev/loop2
Vgcreate CINDER-VOLUMES/DEV/LOOP2
(Losetup-f can query the current first block of unused loopback devices)
Second, after the restart, cinder-volumes this VG disappeared
Third, when using the first command to restore the environment, appear
[Root@compute-192-168-6-50 ~]# PVCREATE/DEV/LOOP2
Can ' t Initialize physical volume "/DEV/LOOP2" of volume Group "cinder-volumes" Without-ff
Iv. in this case, it is necessary to assist logical volumes, volume groups (and uninstall physical volumes, if necessary) in sequence.
Uninstalling logical volumes: Lvremove/dev/volgroup01/logvol00
Uninstall Vg:vgremove VOLGROUP01
V. The current operation of this set of environments is:
Vgremove Cinder-volumes
Six, if you need to save the VG after the boot, set up automatic mount
Cat/etc/rc.d/rc.local |grep Cinder-volumes | | Echo ' losetup-f/var/lib/cinder/cinder-volumes && vgchange-a y cinder-volumes ' >>/etc/rc.d/rc.local