Difference between revisions of "Piston: Command Line Cheatsheet Openstack"

From Define Wiki
Jump to navigation Jump to search
(Created page with "== Keystone (Identity Service) == # List all users keystone user-list # List identity service catalog keystone catalog # Discover keystone endpoints keystone discover #...")
 
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
== Keystone (Identity Service) ==
 
== Keystone (Identity Service) ==
# List all users
+
List all users
 
   keystone user-list
 
   keystone user-list
  
# List identity service catalog
+
List identity service catalog
 
   keystone catalog
 
   keystone catalog
  
# Discover keystone endpoints
+
Discover keystone endpoints
keystone discover
+
  keystone discover
  
# List all services in service catalog
+
List all services in service catalog
keystone service-list
+
  keystone service-list
  
# Create new user
+
Create new user
keystone user-create --name --tenant-id --pass --email --enabled
+
  keystone user-create --name --tenant-id --pass --email --enabled
  
# Create new tenant
+
Create new tenant
keystone tenant-create --name --description --enabled
+
  keystone tenant-create --name --description --enabled
  
Nova (Compute Service)
+
== Nova (Compute Service) ==
# List instances, notice status of instance
+
List instances, notice status of instance
nova list
+
  nova list
  
# List images
+
List images
nova image-list
+
  nova image-list
  
# List flavors
+
List flavors
nova flavor-list
+
  nova flavor-list
  
# Boot an instance using flavor and image names (if names are unique)
+
Boot an instance using flavor and image names (if names are unique)
nova boot --image --flavor
+
  nova boot --image --flavor
nova boot --image cirros-0.3.1-x86_64-uec --flavor m1.tiny MyFirstInstance
+
  nova boot --image cirros-0.3.1-x86_64-uec --flavor m1.tiny MyFirstInstance
  
# Login to instance
+
Login to instance
ip netns
+
  ip netns
sudo ip netns exec ssh <user@server or use a key>
+
  sudo ip netns exec ssh <user@server or use a key>
sudo ip netns exec qdhcp-6021a3b4-8587-4f9c-8064-0103885dfba2 ssh cirros@10.0.0.2
+
  sudo ip netns exec qdhcp-6021a3b4-8587-4f9c-8064-0103885dfba2 ssh cirros@10.0.0.2
# if you are on devstack, password is “cubswin:)” without the quotes
+
  # if you are on devstack, password is “cubswin:)” without the quotes
  
# Show details of instance
+
Show details of instance
nova show <name>
+
  nova show <name>
nova show MyFirstInstance
+
  nova show MyFirstInstance
  
# View console log of instance
+
View console log of instance
nova console-log MyFirstInstance
+
  nova console-log MyFirstInstance
  
# Pause, suspend, stop, rescue, resize, rebuild, reboot an instance
+
=== Pause, suspend, stop, rescue, resize, rebuild, reboot an instance ===
# Pause
+
Pause
nova pause <name>
+
  nova pause <name>
nova pause volumeTwoImage
+
  nova pause volumeTwoImage
  
# Unpause
+
Unpause
nova unpause <name>
+
  nova unpause <name>
  
# Suspend
+
Suspend
nova suspend <name>
+
  nova suspend <name>
  
# Unsuspend
+
Unsuspend
nova resume <name>
+
  nova resume <name>
  
# Stop
+
Stop
nova stop <name>
+
  nova stop <name>
  
# Start
+
Start
nova start <name>
+
  nova start <name>
  
# Rescue
+
Rescue
nova rescue <name>
+
  nova rescue <name>
  
# Resize
+
Resize
nova resize <name> <flavor>
+
  nova resize <name> <flavor>
nova resize my-pem-server m1.small
+
  nova resize my-pem-server m1.small
nova resize-confirm server1
+
  nova resize-confirm server1
  
# Rebuild
+
Rebuild
nova rebuild <name> <image>
+
  nova rebuild <name> <image>
nova rebuild newtinny cirros-qcow2
+
  nova rebuild newtinny cirros-qcow2
  
# Reboot
+
Reboot
nova reboot <name>
+
  nova reboot <name>
nova reboot newtinny
+
  nova reboot newtinny
  
# Inject user data and files into an instance
+
Inject user data and files into an instance
nova boot --user-data ./userdata.txt MyUserdataInstance
+
  nova boot --user-data ./userdata.txt MyUserdataInstance
nova boot --user-data userdata.txt --image cirros-qcow2 --flavor m1.tiny MyUserdataInstance2
+
  nova boot --user-data userdata.txt --image cirros-qcow2 --flavor m1.tiny MyUserdataInstance2
# to validate file is there, ssh into instance, go to /var/lib/cloud look for file
+
  # to validate file is there, ssh into instance, go to /var/lib/cloud look for file
  
# Inject a keypair into an instance and access the instance with that keypair
+
Check nodes/instances/hypervisors
# Create keypair
+
<syntaxhighlight>
nova keypair-add test > test.pem
+
(openstack)[root@piston-gateway ~]# nova hypervisor-list
chmod 600 test.pem
+
+----+---------------------+
 +
| ID | Hypervisor hostname |
 +
+----+---------------------+
 +
| 2  | node-172-16-0-13    |
 +
| 1  | node-172-16-0-15    |
 +
| 3  | node-172-16-0-14    |
 +
| 4  | node-172-16-0-16    |
 +
| 5  | node-172-16-0-17    |
 +
| 6  | node-172-16-0-18    |
 +
+----+---------------------+
 +
(openstack)[root@piston-gateway ~]# nova hypervisor-servers node-172-16-0-13
 +
+--------------------------------------+-------------------+---------------+---------------------+
 +
| ID                                  | Name              | Hypervisor ID | Hypervisor Hostname |
 +
+--------------------------------------+-------------------+---------------+---------------------+
 +
| 73a9c465-6ec1-4f66-b6ea-cae24dac8be9 | instance-00000018 | 2            | node-172-16-0-13    |
 +
| 172dfd24-9f7e-4872-971b-b8541d7fa074 | instance-0000001a | 2            | node-172-16-0-13    |
 +
+--------------------------------------+-------------------+---------------+---------------------+
 +
(openstack)[root@piston-gateway ~]# nova hypervisor-servers node-172-16-0-14
 +
+--------------------------------------+-------------------+---------------+---------------------+
 +
| ID                                  | Name              | Hypervisor ID | Hypervisor Hostname |
 +
+--------------------------------------+-------------------+---------------+---------------------+
 +
| e3dec805-c849-4277-a592-098db6af999d | instance-00000014 | 3            | node-172-16-0-14    |
 +
+--------------------------------------+-------------------+---------------+---------------------+
 +
(openstack)[root@piston-gateway ~]# nova hypervisor-servers node-172-16-0-15
 +
+--------------------------------------+-------------------+---------------+---------------------+
 +
| ID                                  | Name              | Hypervisor ID | Hypervisor Hostname |
 +
+--------------------------------------+-------------------+---------------+---------------------+
 +
| fc6da5be-06ee-46af-bb20-533eb6b57543 | instance-0000000d | 1            | node-172-16-0-15    |
 +
| 673bc324-cd6c-44e4-96f6-f51c6f20cff5 | instance-00000019 | 1            | node-172-16-0-15    |
 +
+--------------------------------------+-------------------+---------------+---------------------+
 +
(openstack)[root@piston-gateway ~]# nova hypervisor-servers node-172-16-0-16
 +
+--------------------------------------+-------------------+---------------+---------------------+
 +
| ID                                  | Name              | Hypervisor ID | Hypervisor Hostname |
 +
+--------------------------------------+-------------------+---------------+---------------------+
 +
| ba0c7bab-dc0a-43b1-9f52-b82d11ae3085 | instance-00000012 | 4            | node-172-16-0-16    |
 +
+--------------------------------------+-------------------+---------------+---------------------+
 +
(openstack)[root@piston-gateway ~]# nova hypervisor-servers node-172-16-0-17
 +
+--------------------------------------+-------------------+---------------+---------------------+
 +
| ID                                  | Name              | Hypervisor ID | Hypervisor Hostname |
 +
+--------------------------------------+-------------------+---------------+---------------------+
 +
| f1f6571a-b1b3-4995-b989-618f44c79889 | instance-00000017 | 5            | node-172-16-0-17    |
 +
+--------------------------------------+-------------------+---------------+---------------------+
 +
(openstack)[root@piston-gateway ~]# nova hypervisor-servers node-172-16-0-18
 +
+--------------------------------------+-------------------+---------------+---------------------+
 +
| ID                                  | Name              | Hypervisor ID | Hypervisor Hostname |
 +
+--------------------------------------+-------------------+---------------+---------------------+
 +
| bacecfa9-0751-4b39-9771-f27f78d6e3b9 | instance-0000001c | 6            | node-172-16-0-18    |
 +
| fe1658fd-79df-4aff-9583-b92c6f39e687 | instance-0000001d | 6            | node-172-16-0-18    |
 +
+--------------------------------------+-------------------+---------------+---------------------+
  
# Boot
+
</syntaxhighlight>
nova boot --image cirros-0.3.0-x86_64 --flavor m1.small --key_name test my-first-server
+
=== Inject a keypair into an instance and access the instance with that keypair ===
 +
Create keypair
 +
  nova keypair-add test > test.pem
 +
  chmod 600 test.pem
  
# ssh into instance
+
Boot
sudo ip netns exec qdhcp-98f09f1e-64c4-4301-a897-5067ee6d544f ssh -i test.pem cirros@10.0.0.4
+
  nova boot --image cirros-0.3.0-x86_64 --flavor m1.small --key_name test my-first-server
  
# Set metadata on an instance
+
ssh into instance
nova meta volumeTwoImage set newmeta=’my meta data’
+
  sudo ip netns exec qdhcp-98f09f1e-64c4-4301-a897-5067ee6d544f ssh -i test.pem cirros@10.0.0.4
  
# Create an instance snapshot
+
Set metadata on an instance
nova image-create volumeTwoImage snapshotOfVolumeImage
+
  nova meta volumeTwoImage set newmeta=’my meta data’
nova image-show snapshotOfVolumeImage
 
  
# Manage security groups
+
Create an instance snapshot
# Add rules to default security group allowing ping and ssh between #instances in the default security group
+
  nova image-create volumeTwoImage snapshotOfVolumeImage
 +
  nova image-show snapshotOfVolumeImage
 +
 
 +
=== Manage security groups ===
 +
Add rules to default security group allowing ping and ssh between #instances in the default security group
 
nova secgroup-add-group-rule default default icmp -1 -1
 
nova secgroup-add-group-rule default default icmp -1 -1
 
nova secgroup-add-group-rule default default tcp 22 22
 
nova secgroup-add-group-rule default default tcp 22 22
  
Glance (Image Service)
+
== Glance (Image Service) ==
# List images you can access
+
List images you can access
glance image-list
+
  glance image-list
  
# Delete specified image
+
Delete specified image
glance image-delete <image>
+
  glance image-delete <image>
  
# Describe a specific image
+
Describe a specific image
glance image-show <image>
+
  glance image-show <image>
  
# update image
+
update image
glance image-update <image>
+
  glance image-update <image>
  
# Manage images
+
=== Manage images ===
# Kernel image
+
Kernel image
glance image-create --name “cirros-threepart-kernel” --disk-format aki --container-format aki --is-public True --file ~/images/cirros-0.3.1~pre4-x86_64-vmlinuz
+
  glance image-create --name “cirros-threepart-kernel” --disk-format aki --container-format aki --is-public True --file ~/images/cirros-0.3.1~pre4-x86_64-vmlinuz
  
# Ram image
+
Ram image
glance image-create—name “cirros-threepart-ramdisk” --disk-format ari --container-format ari --is-public True --file ~/images/cirros-0.3.1~pre4-x86_64-initrd
+
  glance image-create—name “cirros-threepart-ramdisk” --disk-format ari --container-format ari --is-public True --file ~/images/cirros-0.3.1~pre4-x86_64-initrd
  
# 3-part image
+
3-part image
glance image-create—name “cirros-threepart” --disk-format ami --container-format ami --is-public True --property kernel_id=$KID—property ramdisk_id=$RID --file ~/images/cirros-0.3.1~pre4-x86_64-blank.img
+
  glance image-create—name “cirros-threepart” --disk-format ami --container-format ami --is-public True --property kernel_id=$KID—property ramdisk_id=$RID --file ~/images/cirros-0.3.1~pre4-x86_64-blank.img
  
# Register raw image
+
Register raw image
glance image-create --name “cirros-qcow2” --disk-format qcow2 --container-format bare --is-public True --file ~/images/cirros-0.3.1~pre4-x86_64-disk.img
+
  glance image-create --name “cirros-qcow2” --disk-format qcow2 --container-format bare --is-public True --file ~/images/cirros-0.3.1~pre4-x86_64-disk.img
  
Neutron (Networking Service)
+
== Neutron (Networking Service) ==
# Create network
+
Create network
neutron net-create <name>
+
  neutron net-create <name>
neutron net-create my-network
+
  neutron net-create my-network
  
# Create a subnet
+
Create a subnet
neutron subnet-create <network name> <cidr>
+
  neutron subnet-create <network name> <cidr>
neutron subnet-create my-network 10.0.0.0/29
+
  neutron subnet-create my-network 10.0.0.0/29
  
# List network and subnet
+
List network and subnet
neutron net-list
+
  neutron net-list
neutron subnet-list
+
  neutron subnet-list
  
# Examine details of network and subnet
+
Examine details of network and subnet
neutron net-show <id or name of network>
+
  neutron net-show <id or name of network>
neutron subnet-show <id or name of subnet>
+
  neutron subnet-show <id or name of subnet>
  
Cinder (Block Storage)
+
== Cinder (Block Storage) ==
# Manage volumes and volume snapshots
+
Manage volumes and volume snapshots
# Create a new volume
+
Create a new volume
cinder create <size in GB> --display-name
+
  cinder create <size in GB> --display-name
cinder create 1 --display-name MyFirstVolume
+
  cinder create 1 --display-name MyFirstVolume
  
# Boot an instance and attach to volume
+
Boot an instance and attach to volume
nova boot—image cirros-qcow2 --flavor m1.tiny MyVolumeInstance
+
  nova boot—image cirros-qcow2 --flavor m1.tiny MyVolumeInstance
  
# List volumes, notice status of volume
+
List volumes, notice status of volume
cinder list
+
  cinder list
  
# Attach volume to instance after instance is active, and volume is available
+
Attach volume to instance after instance is active, and volume is available
nova volume-attach <instance-id> <volume-id> auto
+
  nova volume-attach <instance-id> <volume-id> auto
nova volume-attach MyVolumeInstance /dev/vdb auto
+
  nova volume-attach MyVolumeInstance /dev/vdb auto
  
# Login into instance, list storage devices
+
Login into instance, list storage devices
sudo fdisk -l
+
  sudo fdisk -l
  
# On the instance, make filesystem on volume
+
On the instance, make filesystem on volume
sudo mkfs.ext3 /dev/vdb
+
  sudo mkfs.ext3 /dev/vdb
  
# Create a mountpoint
+
Create a mountpoint
sudo mkdir /myspace
+
  sudo mkdir /myspace
  
# Mount the volume at the mountpoint
+
Mount the volume at the mountpoint
sudo mount /dev/vdc /myspace
+
  sudo mount /dev/vdc /myspace
  
# Create a file on the volume
+
Create a file on the volume
sudo touch /myspace/helloworld.txt
+
  sudo touch /myspace/helloworld.txt
sudo ls /myspace
+
  sudo ls /myspace
  
# Unmount the volume
+
Unmount the volume
sudo umount /myspace
+
  sudo umount /myspace
  
Swift (Object Store)
+
== Swift (Object Store) ==
# Displays information for the account, container, or object
+
Displays information for the account, container, or object
swift stat
+
  swift stat
swift stat <account>
+
  swift stat <account>
swift stat <container>
+
  swift stat <container>
swift stat <object>
+
  swift stat <object>
  
# List containers
+
List containers
swift list
+
  swift list
  
# Create a container
+
Create a container
swift post mycontainer
+
  swift post mycontainer
  
# Upload file to a container
+
Upload file to a container
swift upload <containder name> <file name>
+
  swift upload <containder name> <filename>
swift upload mycontainer myfile.txt
+
  swift upload mycontainer myfile.txt
  
# List objects in container
+
List objects in container
swift list container
+
  swift list container
  
# Download object from container
+
Download object from container
swift download <containder name> <file name>
+
  swift download <containder name> <filename>
  
# Upload with chunks, for large file
+
Upload with chunks, for large file
swift upload -S <size> <containder name> <file name>
+
  swift upload -S <size> <containder name> <filename>
swift upload -S 64 container largeFile
+
  swift upload -S 64 container largeFile

Latest revision as of 10:40, 16 April 2015

Keystone (Identity Service)

List all users

 keystone user-list

List identity service catalog

 keystone catalog

Discover keystone endpoints

 keystone discover

List all services in service catalog

 keystone service-list

Create new user

 keystone user-create --name --tenant-id --pass --email --enabled

Create new tenant

 keystone tenant-create --name --description --enabled

Nova (Compute Service)

List instances, notice status of instance

 nova list

List images

 nova image-list

List flavors

 nova flavor-list

Boot an instance using flavor and image names (if names are unique)

 nova boot --image --flavor
 nova boot --image cirros-0.3.1-x86_64-uec --flavor m1.tiny MyFirstInstance

Login to instance

 ip netns
 sudo ip netns exec ssh <user@server or use a key>
 sudo ip netns exec qdhcp-6021a3b4-8587-4f9c-8064-0103885dfba2 ssh cirros@10.0.0.2
 # if you are on devstack, password is “cubswin:)” without the quotes

Show details of instance

 nova show <name>
 nova show MyFirstInstance

View console log of instance

 nova console-log MyFirstInstance

Pause, suspend, stop, rescue, resize, rebuild, reboot an instance

Pause

 nova pause <name>
 nova pause volumeTwoImage

Unpause

 nova unpause <name>

Suspend

 nova suspend <name>

Unsuspend

 nova resume <name>

Stop

 nova stop <name>

Start

 nova start <name>

Rescue

 nova rescue <name>

Resize

 nova resize <name> <flavor>
 nova resize my-pem-server m1.small
 nova resize-confirm server1

Rebuild

 nova rebuild <name> <image>
 nova rebuild newtinny cirros-qcow2

Reboot

 nova reboot <name>
 nova reboot newtinny

Inject user data and files into an instance

 nova boot --user-data ./userdata.txt MyUserdataInstance
 nova boot --user-data userdata.txt --image cirros-qcow2 --flavor m1.tiny MyUserdataInstance2
 # to validate file is there, ssh into instance, go to /var/lib/cloud look for file

Check nodes/instances/hypervisors

(openstack)[root@piston-gateway ~]# nova hypervisor-list
+----+---------------------+
| ID | Hypervisor hostname |
+----+---------------------+
| 2  | node-172-16-0-13    |
| 1  | node-172-16-0-15    |
| 3  | node-172-16-0-14    |
| 4  | node-172-16-0-16    |
| 5  | node-172-16-0-17    |
| 6  | node-172-16-0-18    |
+----+---------------------+
(openstack)[root@piston-gateway ~]# nova hypervisor-servers node-172-16-0-13
+--------------------------------------+-------------------+---------------+---------------------+
| ID                                   | Name              | Hypervisor ID | Hypervisor Hostname |
+--------------------------------------+-------------------+---------------+---------------------+
| 73a9c465-6ec1-4f66-b6ea-cae24dac8be9 | instance-00000018 | 2             | node-172-16-0-13    |
| 172dfd24-9f7e-4872-971b-b8541d7fa074 | instance-0000001a | 2             | node-172-16-0-13    |
+--------------------------------------+-------------------+---------------+---------------------+
(openstack)[root@piston-gateway ~]# nova hypervisor-servers node-172-16-0-14
+--------------------------------------+-------------------+---------------+---------------------+
| ID                                   | Name              | Hypervisor ID | Hypervisor Hostname |
+--------------------------------------+-------------------+---------------+---------------------+
| e3dec805-c849-4277-a592-098db6af999d | instance-00000014 | 3             | node-172-16-0-14    |
+--------------------------------------+-------------------+---------------+---------------------+
(openstack)[root@piston-gateway ~]# nova hypervisor-servers node-172-16-0-15
+--------------------------------------+-------------------+---------------+---------------------+
| ID                                   | Name              | Hypervisor ID | Hypervisor Hostname |
+--------------------------------------+-------------------+---------------+---------------------+
| fc6da5be-06ee-46af-bb20-533eb6b57543 | instance-0000000d | 1             | node-172-16-0-15    |
| 673bc324-cd6c-44e4-96f6-f51c6f20cff5 | instance-00000019 | 1             | node-172-16-0-15    |
+--------------------------------------+-------------------+---------------+---------------------+
(openstack)[root@piston-gateway ~]# nova hypervisor-servers node-172-16-0-16
+--------------------------------------+-------------------+---------------+---------------------+
| ID                                   | Name              | Hypervisor ID | Hypervisor Hostname |
+--------------------------------------+-------------------+---------------+---------------------+
| ba0c7bab-dc0a-43b1-9f52-b82d11ae3085 | instance-00000012 | 4             | node-172-16-0-16    |
+--------------------------------------+-------------------+---------------+---------------------+
(openstack)[root@piston-gateway ~]# nova hypervisor-servers node-172-16-0-17
+--------------------------------------+-------------------+---------------+---------------------+
| ID                                   | Name              | Hypervisor ID | Hypervisor Hostname |
+--------------------------------------+-------------------+---------------+---------------------+
| f1f6571a-b1b3-4995-b989-618f44c79889 | instance-00000017 | 5             | node-172-16-0-17    |
+--------------------------------------+-------------------+---------------+---------------------+
(openstack)[root@piston-gateway ~]# nova hypervisor-servers node-172-16-0-18
+--------------------------------------+-------------------+---------------+---------------------+
| ID                                   | Name              | Hypervisor ID | Hypervisor Hostname |
+--------------------------------------+-------------------+---------------+---------------------+
| bacecfa9-0751-4b39-9771-f27f78d6e3b9 | instance-0000001c | 6             | node-172-16-0-18    |
| fe1658fd-79df-4aff-9583-b92c6f39e687 | instance-0000001d | 6             | node-172-16-0-18    |
+--------------------------------------+-------------------+---------------+---------------------+

Inject a keypair into an instance and access the instance with that keypair

Create keypair

 nova keypair-add test > test.pem
 chmod 600 test.pem

Boot

 nova boot --image cirros-0.3.0-x86_64 --flavor m1.small --key_name test my-first-server

ssh into instance

 sudo ip netns exec qdhcp-98f09f1e-64c4-4301-a897-5067ee6d544f ssh -i test.pem cirros@10.0.0.4

Set metadata on an instance

 nova meta volumeTwoImage set newmeta=’my meta data’

Create an instance snapshot

 nova image-create volumeTwoImage snapshotOfVolumeImage
 nova image-show snapshotOfVolumeImage

Manage security groups

Add rules to default security group allowing ping and ssh between #instances in the default security group nova secgroup-add-group-rule default default icmp -1 -1 nova secgroup-add-group-rule default default tcp 22 22

Glance (Image Service)

List images you can access

 glance image-list

Delete specified image

 glance image-delete <image>

Describe a specific image

 glance image-show <image>

update image

 glance image-update <image>

Manage images

Kernel image

 glance image-create --name “cirros-threepart-kernel” --disk-format aki --container-format aki --is-public True --file ~/images/cirros-0.3.1~pre4-x86_64-vmlinuz

Ram image

 glance image-create—name “cirros-threepart-ramdisk” --disk-format ari --container-format ari --is-public True --file ~/images/cirros-0.3.1~pre4-x86_64-initrd

3-part image

 glance image-create—name “cirros-threepart” --disk-format ami --container-format ami --is-public True --property kernel_id=$KID—property ramdisk_id=$RID --file ~/images/cirros-0.3.1~pre4-x86_64-blank.img

Register raw image

 glance image-create --name “cirros-qcow2” --disk-format qcow2 --container-format bare --is-public True --file ~/images/cirros-0.3.1~pre4-x86_64-disk.img

Neutron (Networking Service)

Create network

 neutron net-create <name>
 neutron net-create my-network

Create a subnet

 neutron subnet-create <network name> <cidr>
 neutron subnet-create my-network 10.0.0.0/29

List network and subnet

 neutron net-list
 neutron subnet-list

Examine details of network and subnet

 neutron net-show <id or name of network>
 neutron subnet-show <id or name of subnet>

Cinder (Block Storage)

Manage volumes and volume snapshots Create a new volume

 cinder create <size in GB> --display-name
 cinder create 1 --display-name MyFirstVolume

Boot an instance and attach to volume

 nova boot—image cirros-qcow2 --flavor m1.tiny MyVolumeInstance

List volumes, notice status of volume

 cinder list

Attach volume to instance after instance is active, and volume is available

 nova volume-attach <instance-id> <volume-id> auto
 nova volume-attach MyVolumeInstance /dev/vdb auto

Login into instance, list storage devices

 sudo fdisk -l

On the instance, make filesystem on volume

 sudo mkfs.ext3 /dev/vdb

Create a mountpoint

 sudo mkdir /myspace

Mount the volume at the mountpoint

 sudo mount /dev/vdc /myspace

Create a file on the volume

 sudo touch /myspace/helloworld.txt
 sudo ls /myspace

Unmount the volume

 sudo umount /myspace

Swift (Object Store)

Displays information for the account, container, or object

 swift stat
 swift stat <account>
 swift stat <container>
 swift stat <object>

List containers

 swift list

Create a container

 swift post mycontainer

Upload file to a container

 swift upload <containder name> <filename>
 swift upload mycontainer myfile.txt

List objects in container

 swift list container

Download object from container

 swift download <containder name> <filename>

Upload with chunks, for large file

 swift upload -S <size> <containder name> <filename>
 swift upload -S 64 container largeFile