Can't make a volume in Available ....

Asked by Hugo Kou

=====================Info from Volume worker-============================
INFO:root:volume vol-ug9et8xg: creating
2010-11-14 23:15:04+0800 [-] (root): INFO volume vol-ug9et8xg: creating
DEBUG:root:volume vol-ug9et8xg: creating lv of size 1G
2010-11-14 23:15:04+0800 [-] (root): DEBUG volume vol-ug9et8xg: creating lv of size 1G
DEBUG:root:Running cmd: sudo lvcreate -L 1G -n vol-ug9et8xg nova-volumes
2010-11-14 23:15:04+0800 [-] (root): DEBUG Running cmd: sudo lvcreate -L 1G -n vol-ug9et8xg nova-volumes
DEBUG:root:volume vol-ug9et8xg: creating export
2010-11-14 23:15:04+0800 [-] (root): DEBUG volume vol-ug9et8xg: creating export
DEBUG:root:Running cmd: sudo ietadm --op new --tid=2 --params Name=iqn.2010-10.org.openstack:vol-ug9et8xg
2010-11-14 23:15:04+0800 [-] (root): DEBUG Running cmd: sudo ietadm --op new --tid=2 --params Name=iqn.2010-10.org.openstack:vol-ug9et8xg
2010-11-14 23:15:04+0800 [-] Unhandled error in Deferred:
2010-11-14 23:15:04+0800 [-] Unhandled Error
        Traceback (most recent call last):
        Failure: nova.exception.ProcessExecutionError: Unexpected error while running command.
        Command: sudo ietadm --op new --tid=2 --params Name=iqn.2010-10.org.openstack:vol-ug9et8xg
        Exit code: 145
        Stdout: ''
        Stderr: 'Connection refused.\n'
===========================================================================

==============================================
$ euca-attach-volume -i i-wyu8vc -d /dev/vdb vol-ug9et8xg
Unknown: Volume status must be available
==============================================

when I create a volume , the status always stay on "Creating".
so that I check the volume worker screen, and I think the problem is "Connection refused"

I just try to install NOVA in single machine......

I want to attch a volume for instance. Like EBS.

Could you plz help me to solve the problem?

Question information

Language:
English Edit question
Status:
Solved
For:
OpenStack Compute (nova) Edit question
Assignee:
No assignee Edit question
Solved by:
Vish Ishaya
Solved:
Last query:
Last reply:
Revision history for this message
Vish Ishaya (vishvananda) said :
#1

This happens if iscsitarget is not running. The ubuntu package does not enable the service by default. This will get it working, and I'm adding it to novascript as well.
sudo /etc/init.d/iscsitarget restart
echo "ISCSITARGET_ENABLE=true" | sudo tee /etc/default/iscsitarget

Vish

On Nov 14, 2010, at 7:47 AM, Hugo Kou wrote:

> New question #134020 on OpenStack Compute (nova):
> https://answers.launchpad.net/nova/+question/134020
>
>
> =====================Info from Volume worker-============================
> INFO:root:volume vol-ug9et8xg: creating
> 2010-11-14 23:15:04+0800 [-] (root): INFO volume vol-ug9et8xg: creating
> DEBUG:root:volume vol-ug9et8xg: creating lv of size 1G
> 2010-11-14 23:15:04+0800 [-] (root): DEBUG volume vol-ug9et8xg: creating lv of size 1G
> DEBUG:root:Running cmd: sudo lvcreate -L 1G -n vol-ug9et8xg nova-volumes
> 2010-11-14 23:15:04+0800 [-] (root): DEBUG Running cmd: sudo lvcreate -L 1G -n vol-ug9et8xg nova-volumes
> DEBUG:root:volume vol-ug9et8xg: creating export
> 2010-11-14 23:15:04+0800 [-] (root): DEBUG volume vol-ug9et8xg: creating export
> DEBUG:root:Running cmd: sudo ietadm --op new --tid=2 --params Name=iqn.2010-10.org.openstack:vol-ug9et8xg
> 2010-11-14 23:15:04+0800 [-] (root): DEBUG Running cmd: sudo ietadm --op new --tid=2 --params Name=iqn.2010-10.org.openstack:vol-ug9et8xg
> 2010-11-14 23:15:04+0800 [-] Unhandled error in Deferred:
> 2010-11-14 23:15:04+0800 [-] Unhandled Error
> Traceback (most recent call last):
> Failure: nova.exception.ProcessExecutionError: Unexpected error while running command.
> Command: sudo ietadm --op new --tid=2 --params Name=iqn.2010-10.org.openstack:vol-ug9et8xg
> Exit code: 145
> Stdout: ''
> Stderr: 'Connection refused.\n'
> ===========================================================================
>
> ==============================================
> $ euca-attach-volume -i i-wyu8vc -d /dev/vdb vol-ug9et8xg
> Unknown: Volume status must be available
> ==============================================
>
> when I create a volume , the status always stay on "Creating".
> so that I check the volume worker screen, and I think the problem is "Connection refused"
>
>
> I just try to install NOVA in single machine......
>
> I want to attch a volume for instance. Like EBS.
>
>
> Could you plz help me to solve the problem?
>
> --
> You received this question notification because you are a member of Nova
> Core, which is an answer contact for OpenStack Compute (nova).

Revision history for this message
Vish Ishaya (vishvananda) said :
#2

I pasted those lines in the wrong order. It should be:
echo "ISCSITARGET_ENABLE=true" | sudo tee /etc/default/iscsitarget
sudo /etc/init.d/iscsitarget restart

On Nov 14, 2010, at 1:09 PM, Vish Ishaya wrote:

> Question #134020 on OpenStack Compute (nova) changed:
> https://answers.launchpad.net/nova/+question/134020
>
> Status: Open => Answered
>
> Vish Ishaya proposed the following answer:
> This happens if iscsitarget is not running. The ubuntu package does not enable the service by default. This will get it working, and I'm adding it to novascript as well.
> sudo /etc/init.d/iscsitarget restart
> echo "ISCSITARGET_ENABLE=true" | sudo tee /etc/default/iscsitarget
>
> Vish
>
> On Nov 14, 2010, at 7:47 AM, Hugo Kou wrote:
>
>> New question #134020 on OpenStack Compute (nova):
>> https://answers.launchpad.net/nova/+question/134020
>>
>>
>> =====================Info from Volume worker-============================
>> INFO:root:volume vol-ug9et8xg: creating
>> 2010-11-14 23:15:04+0800 [-] (root): INFO volume vol-ug9et8xg: creating
>> DEBUG:root:volume vol-ug9et8xg: creating lv of size 1G
>> 2010-11-14 23:15:04+0800 [-] (root): DEBUG volume vol-ug9et8xg: creating lv of size 1G
>> DEBUG:root:Running cmd: sudo lvcreate -L 1G -n vol-ug9et8xg nova-volumes
>> 2010-11-14 23:15:04+0800 [-] (root): DEBUG Running cmd: sudo lvcreate -L 1G -n vol-ug9et8xg nova-volumes
>> DEBUG:root:volume vol-ug9et8xg: creating export
>> 2010-11-14 23:15:04+0800 [-] (root): DEBUG volume vol-ug9et8xg: creating export
>> DEBUG:root:Running cmd: sudo ietadm --op new --tid=2 --params Name=iqn.2010-10.org.openstack:vol-ug9et8xg
>> 2010-11-14 23:15:04+0800 [-] (root): DEBUG Running cmd: sudo ietadm --op new --tid=2 --params Name=iqn.2010-10.org.openstack:vol-ug9et8xg
>> 2010-11-14 23:15:04+0800 [-] Unhandled error in Deferred:
>> 2010-11-14 23:15:04+0800 [-] Unhandled Error
>> Traceback (most recent call last):
>> Failure: nova.exception.ProcessExecutionError: Unexpected error while running command.
>> Command: sudo ietadm --op new --tid=2 --params Name=iqn.2010-10.org.openstack:vol-ug9et8xg
>> Exit code: 145
>> Stdout: ''
>> Stderr: 'Connection refused.\n'
>> ===========================================================================
>>
>> ==============================================
>> $ euca-attach-volume -i i-wyu8vc -d /dev/vdb vol-ug9et8xg
>> Unknown: Volume status must be available
>> ==============================================
>>
>> when I create a volume , the status always stay on "Creating".
>> so that I check the volume worker screen, and I think the problem is "Connection refused"
>>
>>
>> I just try to install NOVA in single machine......
>>
>> I want to attch a volume for instance. Like EBS.
>>
>>
>> Could you plz help me to solve the problem?
>>
>> --
>> You received this question notification because you are a member of Nova
>> Core, which is an answer contact for OpenStack Compute (nova).
>
> You received this question notification because you are a member of Nova
> Core, which is an answer contact for OpenStack Compute (nova).

Revision history for this message
Hugo Kou (tonytkdk) said :
#3

Really useful information , thanks Vish

Revision history for this message
Hugo Kou (tonytkdk) said :
#4

2010-11-15 14:11:50+0800 [-] File "/home/hugo/nova/nova/volume/manager.py", line 61, in init_host
2010-11-15 14:11:50+0800 [-] self.driver.check_for_setup_error()
2010-11-15 14:11:50+0800 [-] File "/home/hugo/nova/nova/volume/driver.py", line 87, in check_for_setup_error
2010-11-15 14:11:50+0800 [-] % FLAGS.volume_group)
2010-11-15 14:11:50+0800 [-] nova.exception.Error: volume group nova-volumes doesn't exist

root@ubuntu:~# vgdisplay
  --- 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 1020.00 MiB
  PE Size 4.00 MiB
  Total PE 255
  Alloc PE / Size 0 / 0
  Free PE / Size 255 / 1020.00 MiB
  VG UUID J4DpV1-6hAi-ynZE-yov8-yeLr-jhQ9-rFifrg

nova-volumes doesn't exist @@
but it's really here.....
I make the Volume by steps of novascript

Revision history for this message
Best Vish Ishaya (vishvananda) said :
#5

nova-volume checks for the existence of nova-volumes by looking for /dev/nova-volumes, which i recently discovered only gets created after the first logical volume is created. You should be able to just create a small test volume like so:
lvcreate -L 1G --name test nova-volumes

Vish
On Nov 14, 2010, at 10:15 PM, Hugo Kou wrote:

> Question #134020 on OpenStack Compute (nova) changed:
> https://answers.launchpad.net/nova/+question/134020
>
> Status: Answered => Open
>
> Hugo Kou is still having a problem:
> 2010-11-15 14:11:50+0800 [-] File "/home/hugo/nova/nova/volume/manager.py", line 61, in init_host
> 2010-11-15 14:11:50+0800 [-] self.driver.check_for_setup_error()
> 2010-11-15 14:11:50+0800 [-] File "/home/hugo/nova/nova/volume/driver.py", line 87, in check_for_setup_error
> 2010-11-15 14:11:50+0800 [-] % FLAGS.volume_group)
> 2010-11-15 14:11:50+0800 [-] nova.exception.Error: volume group nova-volumes doesn't exist
>
> root@ubuntu:~# vgdisplay
> --- 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 1020.00 MiB
> PE Size 4.00 MiB
> Total PE 255
> Alloc PE / Size 0 / 0
> Free PE / Size 255 / 1020.00 MiB
> VG UUID J4DpV1-6hAi-ynZE-yov8-yeLr-jhQ9-rFifrg
>
>
> nova-volumes doesn't exist @@
> but it's really here.....
> I make the Volume by steps of novascript
>
> You received this question notification because you are a member of Nova
> Core, which is an answer contact for OpenStack Compute (nova).

Revision history for this message
Hugo Kou (tonytkdk) said :
#6

Hey Vish thanks for your help ... I feel so happy now~
I totally shot down the problem..........nova-volume checks for existence of /dev/nova-volumes <~~~that's real!!

I'll show some of my experience .
=============================================
1. echo "ISCSITARGET_ENABLE=true" | sudo tee /etc/default/iscsitarget
2. sudo /etc/init.d/iscsitarget restart
             (or get Vish's new novascript 2010-11-15 updated)

3.dd if=/dev/zero of=<you named a loopback device as your will> bs=<size ex.1G> count=<bs counts>

4.losetup -f --show <your loopback device file name>
   >/dev/loopX

5. apt-get -y install lvm2

6. vgcreate nova-volumes /dev/loopX

7. vgdisplay
(to make sure how many PE do I have)

8. lvcreat -L 1G -n test nova-volumes

9. ls /dev/nova*
(if there is a floder named nova-volumes , success!)

=========================================

!FINALLY!
root@ubuntu:/# euca-describe-volumes
VOLUME vol-o0nsk4l7 1 nova available (admin, ubuntu, None, None) 2010-11-15 07:58:53.577630

Revision history for this message
Hugo Kou (tonytkdk) said :
#7

Thanks Vish Ishaya, that solved my question.

Revision history for this message
Vish Ishaya (vishvananda) said :
#8

s/lvcreat/lvcreate