you are right, if you make sure that the volume group already exists, the volume creation does work. However, I went back to my config and saw that I do pass the flag storage_dev=/dev/loop0 on the command line. I also noticed that I do not pass the --nodaemon switch.
When I launch nova-volume without --nodaemon 'vgcreate' does not seem to get called. Is that possible? Instead when I launch nova-volume with the --nodaemon, vgcreate does get called. I did instrument the code and compared the log output in the two cases (latest lines of the logs are interesting):
--- Volume group ---
VG Name nova-volumes
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 1
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 10.00 GiB
PE Size 4.00 MiB
Total PE 2559
Alloc PE / Size 0 / 0
Free PE / Size 2559 / 10.00 GiB
VG UUID xiORYR-dJ0P-pu2e-QiDx-nstm-PwWh-7HuJHZ
you are right, if you make sure that the volume group already exists, the volume creation does work. However, I went back to my config and saw that I do pass the flag storage_ dev=/dev/ loop0 on the command line. I also noticed that I do not pass the --nodaemon switch.
When I launch nova-volume without --nodaemon 'vgcreate' does not seem to get called. Is that possible? Instead when I launch nova-volume with the --nodaemon, vgcreate does get called. I did instrument the code and compared the log output in the two cases (latest lines of the logs are interesting):
**** NOVA-VOLUME WITHOUT --NODAEMON SWITCH **** storage_ availability_ zone : nova volume_ topic : volume encrypted : None compute_ topic : compute default_ kernel : aki-11111 report_ profile : None rabbit_ password : guest vpn_key_ suffix : -key localhost: 8773/services/ Cloud originalname : None connection_ type : libvirt fake_rabbit : False help_reactors : None rabbit_ host : 10.70.177.14 process_ pool_size : 4 nothotshot : None fake_storage : False volume_ group : nova-volumes /openstack/ nova-volume. pid savestats : None rabbit_ userid : guest storage_ dev : /dev/loop0 default_ instance_ type : m1.small report_ interval : 10 blades_ per_shelf : 16 node_availabili ty_zone : nova aoe_eth_ dev : eth0 auth_token_ ttl : 3600 rabbit_ port : 5672 vpn_image_ id : ami-CLOUDPIPE last_shelf_ id : 149 aoe_export_ dir : /var/lib/ vblade- persist/ vblades rabbit_ virtual_ host : / node_name : phantom redis_host : 127.0.0.1 default_ image : ami-11111 control_ exchange : nova default_ ramdisk : ari-11111 redis_port : 6379 /openstack/ nova/trunk/ bin/nova- volume first_shelf_ id : 140 fake_network : False network_ topic : network root:Starting volume node Executing: sudo ['pvcreate', '/dev/loop0']:
Starting Nova Volume
DEBUG:root:Full set of FLAGS:
DEBUG:root:help : None
DEBUG:root:
DEBUG:root:
DEBUG:root:verbose : True
DEBUG:root:
DEBUG:root:
DEBUG:root:
DEBUG:root:
DEBUG:root:
DEBUG:root:syslog : None
DEBUG:root:prefix : nova-volume
DEBUG:root:
DEBUG:root:ec2_url : http://
DEBUG:root:
DEBUG:root:rundir : .
DEBUG:root:profiler : hotshot
DEBUG:root:uid : None
DEBUG:root:
DEBUG:root:
DEBUG:root:s3_port : 3333
DEBUG:root:
DEBUG:root:
DEBUG:root:source : None
DEBUG:root:
DEBUG:root:umask : None
DEBUG:root:
DEBUG:root:debug : False
DEBUG:root:
DEBUG:root:redis_db : 0
DEBUG:root:gid : None
DEBUG:root:
DEBUG:root:reactor : None
DEBUG:root:pidfile : /home/openstack
DEBUG:root:
DEBUG:root:
DEBUG:root:
DEBUG:root:file : twistd.tap
DEBUG:root:
DEBUG:root:
DEBUG:root:
DEBUG:root:
DEBUG:root:version : None
DEBUG:root:
DEBUG:root:
DEBUG:root:
DEBUG:root:chroot : None
DEBUG:root:profile : None
DEBUG:root:euid : None
DEBUG:root:
DEBUG:root:logfile : nova-volume.log
DEBUG:root:nodaemon : None
DEBUG:root:b : None
DEBUG:root:
DEBUG:root:no_save : True
DEBUG:root:
DEBUG:root:
DEBUG:root:
DEBUG:root:
DEBUG:root:spew : None
DEBUG:root:r : None
DEBUG:root:
DEBUG:root:
DEBUG:root:
DEBUG:root:
DEBUG:root:s3_host : 127.0.0.1
DEBUG:root:python : /home/openstack
DEBUG:root:
DEBUG:root:
DEBUG:root:
WARNING:
DEBUG:root:*** before_pvcreate ***
DEBUG:root:
DEBUG:root:>> execute
DEBUG:root:<< execute
DEBUG:root:exe output: <Deferred at 0xa700dec current result: <Deferred at 0xa700e2c>>
The last few lines are logging messages I added in _init_volume_group, simple_execute and execute. If I execute vgdislay on the shell I get nothing.
**** NOVA-VOLUME WITH --NODAEMON SWITCH ****
Starting Nova Volume storage_ availability_ zone : nova volume_ topic : volume encrypted : None compute_ topic : compute default_ kernel : aki-11111 report_ profile : None rabbit_ password : guest vpn_key_ suffix : -key localhost: 8773/services/ Cloud originalname : None connection_ type : libvirt fake_rabbit : False help_reactors : None rabbit_ host : 127.0.0.1 process_ pool_size : 4 nothotshot : None fake_storage : False volume_ group : nova-volumes /openstack/ nova-volume. pid savestats : None rabbit_ userid : guest storage_ dev : /dev/loop0 default_ instance_ type : m1.small report_ interval : 10 blades_ per_shelf : 16 node_availabili ty_zone : nova aoe_eth_ dev : eth0 auth_token_ ttl : 3600 rabbit_ port : 5672 vpn_image_ id : ami-CLOUDPIPE last_shelf_ id : 149 aoe_export_ dir : /var/lib/ vblade- persist/ vblades rabbit_ virtual_ host : / node_name : phantom redis_host : 127.0.0.1 default_ image : ami-11111 control_ exchange : nova default_ ramdisk : ari-11111 redis_port : 6379 /openstack/ nova/trunk/ bin/nova- volume first_shelf_ id : 140 fake_network : False network_ topic : network root:Starting volume node Executing: sudo ['pvcreate', '/dev/loop0']: internet. selectreactor. SelectReactor. Executing: sudo ['vgcreate', 'nova-volumes', '/dev/loop0']:
DEBUG:root:Full set of FLAGS:
DEBUG:root:help : None
DEBUG:root:
DEBUG:root:
DEBUG:root:verbose : True
DEBUG:root:
DEBUG:root:
DEBUG:root:
DEBUG:root:
DEBUG:root:
DEBUG:root:syslog : None
DEBUG:root:prefix : nova-volume
DEBUG:root:
DEBUG:root:ec2_url : http://
DEBUG:root:
DEBUG:root:rundir : .
DEBUG:root:profiler : hotshot
DEBUG:root:uid : None
DEBUG:root:
DEBUG:root:
DEBUG:root:s3_port : 3333
DEBUG:root:
DEBUG:root:
DEBUG:root:source : None
DEBUG:root:
DEBUG:root:umask : None
DEBUG:root:
DEBUG:root:debug : False
DEBUG:root:
DEBUG:root:redis_db : 0
DEBUG:root:gid : None
DEBUG:root:
DEBUG:root:reactor : None
DEBUG:root:pidfile : /home/openstack
DEBUG:root:
DEBUG:root:
DEBUG:root:
DEBUG:root:file : twistd.tap
DEBUG:root:
DEBUG:root:
DEBUG:root:
DEBUG:root:
DEBUG:root:version : None
DEBUG:root:
DEBUG:root:
DEBUG:root:
DEBUG:root:chroot : None
DEBUG:root:profile : None
DEBUG:root:euid : None
DEBUG:root:
DEBUG:root:logfile : -
DEBUG:root:nodaemon : True
DEBUG:root:b : None
DEBUG:root:
DEBUG:root:no_save : True
DEBUG:root:
DEBUG:root:
DEBUG:root:
DEBUG:root:
DEBUG:root:spew : None
DEBUG:root:r : None
DEBUG:root:
DEBUG:root:
DEBUG:root:
DEBUG:root:
DEBUG:root:s3_host : 10.70.177.40
DEBUG:root:python : /home/openstack
DEBUG:root:
DEBUG:root:
DEBUG:root:
WARNING:
DEBUG:root:*** before_pvcreate ***
DEBUG:root:
DEBUG:root:>> execute
DEBUG:root:<< execute
DEBUG:root:exe output: <Deferred at 0x8f89dec current result: <Deferred at 0x8f89e2c>>
2010-08-19 10:17:06+0100 [-] Log opened.
2010-08-19 10:17:06+0100 [-] twistd 10.0.0 (/usr/bin/python 2.6.5) starting up.
2010-08-19 10:17:06+0100 [-] reactor class: twisted.
DEBUG:root:*** after_pvcreate ***
2010-08-19 10:17:06+0100 [-] (root): DEBUG *** after_pvcreate ***
DEBUG:root:
2010-08-19 10:17:06+0100 [-] (root): DEBUG Executing: sudo ['vgcreate', 'nova-volumes', '/dev/loop0']:
DEBUG:root:>> execute
2010-08-19 10:17:06+0100 [-] (root): DEBUG >> execute
DEBUG:root:<< execute
2010-08-19 10:17:06+0100 [-] (root): DEBUG << execute
DEBUG:root:exe output: <Deferred at 0x8fa608c current result: <Deferred at 0x8fa660c>>
2010-08-19 10:17:06+0100 [-] (root): DEBUG exe output: <Deferred at 0x8fa608c current result: <Deferred at 0x8fa660c>>
DEBUG:root:***after vgcreate ***
2010-08-19 10:17:06+0100 [-] (root): DEBUG ***after vgcreate ***
vgdisplay says:
--- Volume group --- dJ0P-pu2e- QiDx-nstm- PwWh-7HuJHZ
VG Name nova-volumes
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 1
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 10.00 GiB
PE Size 4.00 MiB
Total PE 2559
Alloc PE / Size 0 / 0
Free PE / Size 2559 / 10.00 GiB
VG UUID xiORYR-
Hope this help