Hello!

I am trying to use the rax_cbs module to create a cloud block storage 
volume in Rackspace Cloud. Pyrax is working as I am having no problems 
launching cloud servers using the rax module. Here is the issue I am 
facing. I think it may have something do with hosts: localhost but I am not 
certain what I am missing here. I am using the example straight from the 
docs slightly edited:

---
- name: Build a Block Storage Volume
  gather_facts: False
  hosts: localhost
  connection: local
  tasks:
    - name: Storage volume create request
      local_action:
        module: rax_cbs
        credentials: ~/.rackspace_cloud_credentials
        name: my-volume
        description: My Volume
        volume_type: SSD
        size: 150
        region: DFW
        wait: yes
        state: present
        meta:
          app: my-cool-app
      register: my_volume

And here's what the run looks like:

PLAY [Build a Block Storage Volume] 
*******************************************

TASK: [Storage volume create request] 
*****************************************
<127.0.0.1> REMOTE_MODULE rax_cbs 
credentials='~/.rackspace_cloud_credentials' state=present volume_type=SSD 
description='My Volume' region=DFW name=my-volume
failed: [localhost] => {"failed": true}
msg: No CloudBlockStorageVolume matching: {'name': 'my-volume'}. (HTTP 404)

FATAL: all hosts have already failed -- aborting

PLAY RECAP 
********************************************************************
           to retry, use: --limit @/root/playbook3.retry

localhost                  : ok=0    changed=0    unreachable=0    failed=1

Now if I go manually create the CBS volume then run the play this is what 
happens:

PLAY [Build a Block Storage Volume] 
*******************************************

TASK: [Storage volume create request] 
*****************************************
<127.0.0.1> REMOTE_MODULE rax_cbs 
credentials='~/.rackspace_cloud_credentials' state=present volume_type=SSD 
description='My Volume' region=DFW name=my-volume
ok: [localhost] => {"changed": false, "volume": {"attachments": [], 
"availability_zone": "nova", "bootable": "false", "created_at": 
"2014-05-25T22:02:20.000000", "display_description": null, "display_name": 
"my-volume", "id": "0b4f9125-2931-4851-ade5-53e4351c639f", "metadata": 
{"storage-node": "b9907568-e40a-424e-bc57-9f39a51c2ee1"}, 
"os-vol-host-attr:host": "lunr", "os-vol-mig-status-attr:migstat": null, 
"os-vol-mig-status-attr:name_id": null, "os-vol-tenant-attr:tenant_id": 
"548880", "size": 150, "snapshot_id": null, "source_volid": null, "status": 
"available", "volume_type": "SSD"}}

PLAY RECAP 
********************************************************************
localhost                  : ok=1    changed=0    unreachable=0    failed=0

Not quite sure what I am missing here. If someone could point me in the 
right direction it would be mucho appreciated. I also tried pulling a list 
of the CBS volume I manually created with pyrax but I can't seem to get 
that to work either. I can pull servers though no problem.

Example:

In [9]: cs = pyrax.cloudservers

In [10]: cs.servers.list()
Out[10]:
[<Server: gluster-client1>,
 <Server: gluster4>,
 <Server: gluster3>,
 <Server: gluster2>,
 <Server: gluster1>,
 <Server: jhyelton1>,
 <Server: jimmyp-rh-openstack-pleasedontdelete>]

In [11]: cbs = pyrax.cloud_blockstorage

In [12]: cbs.list()
Out[12]: []

In [13]: list = cbs.list()

In [14]: for i in list:
   ....:     print i
   ....:
   ....:

In [15]:

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/41544510-ac16-4140-848b-9d3f7b043b87%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to