Object Storage
OpenStack Object Storage (swift) service provides software that stores and retrieves data over HTTP. Objects (blobs of data) are stored in an organizational hierarchy that offers anonymous read-only access, ACL defined access, or even temporary access. Object Storage supports multiple token-based authentication mechanisms implemented via middleware.
Object Storage account terminology
OpenStack Object Storage account
Collection of containers; not user accounts or authentication. Which users are associated with the account and how they may access it depends on the authentication system used. See Object Storage authentication.
Openstack Object Storage containters
Collection of objects. Metadata on the container is available for ACLs. The meaning of ACLs is dependent on the authentication system used.
Object Storage operations via Horizon
Containter creation
Login with your Fenix AAI, RES or HPC account via Web Access -- Horizon OpenStack Service.
On panel Project -> Object Storage -> Containers Click on "+ Container".
Fill out the name field and Select the Container Access "Public or no Public".
Operations into a Container
Login with your Fenix AAI, RES or HPC account via Web Access -- Horizon OpenStack Service.
On panel Project -> Object Storage -> Containers
Create a folder into a container
Upload a file into a container
Download a file from a container
Object Storage operations via OSC
Container creation
1.Use your app credentials. For more information, goes to subsection 3.2 CLI Access:
$ source app-cred-openrc.sh
2.Get a token. It will be necessary for any swift operations
$ openstack token issue
+------------+--------------------------------+
| Field | Value |
+------------+--------------------------------+
| expires | 2021-05-25T10:15:18+0000 |
| id | <token-id> |
| project_id | <project-id> |
| user_id | <user-id> |
+------------+--------------------------------+
3.Create a container
$ openstack container create container-01
4.List your account
$ openstack container show container-01
+--------------+---------------------------------------+
| Field | Value |
+--------------+---------------------------------------+
| account | AUTH_account |
| bytes_used | 8063 |
| container | container-01 |
| object_count | 1 |
+--------------+---------------------------------------+
5.List containers
$ openstack container list
+-----------------------+
| Name |
+-----------------------+
| container-01 |
+-----------------------+
$ swift --os-auth-token <token-id> --os-storage-url https://swift.bsc.es/v1/AUTH_account list
container-01
Uploads files or directories
$ openstack object create container-01 folder-01/file-01.txt
+-----------------------+--------------+----------------------------------+
| object | container | etag |
+-----------------------+--------------+----------------------------------+
| folder-01/file-01.txt | container-01 | d41d8cd98f00b204e9800998ecf8427e |
+-----------------------+--------------+----------------------------------+
$ openstack object list container-01
+-----------------------+
| Name |
+-----------------------+
| folder-01/file-01.txt |
+-----------------------+
OR
$ swift --os-auth-token <token-id> --os-storage-url https://swift.bsc.es/v1/AUTH_account upload container-01 folder-01
$ swift --os-auth-token <token-id> --os-storage-url https://swift.bsc.es/v1/AUTH_account upload container-01/folder01 file-01.txt
$ swift --os-auth-token <token-id> --os-storage-url https://swift.bsc.es/v1/AUTH_account/container-01 list
folder-01
folder-01/file-01.txt
Download a file
$ openstack object save container-01 folder-01/file-01.txt
OR
$ swift --os-auth-token <token-id> --os-storage-url https://swift.bsc.es/v1/AUTH_account/container-01 list
folder-01
folder-01/file-01.txt
$ swift --os-auth-token <token-id> --os-storage-url https://swift.bsc.es/v1/AUTH_account download container-01 folder-01/file-01.txt
file-01.txt [auth 0.000s, headers 1.464s, total 1.475s, 0.005 MB/s]
Backup Volumes
Swift and Cinder Backup services are enabled to support the backup and restore of your volumes into and from your containers using OSC.
Backup
List Volumes and Snapshots
$ openstack volume list
$ openstack volume snapshot list
- Full Backup
$ openstack volume backup create --force --name <backup-name> --description <backup-description>
--container <container> <volume-name>
- Incremental Backup
$ openstack volume backup create --force --incremental --name <backup-name> --description <backup-description>
--container <container> <volume-name>
- Backup a snapshot
$ openstack volume backup create --force --name <backup-name> --description <backup-description> --container <container>
--snapshot <snapshot-id> <volume-name>
Restore
The volume to restore must be available
$ openstack volume list
$ openstack volume backup restore <volume-backup-id> <volume-id>