OpenStack : Uploading objects

  • (4.0)
  • | 917 Ratings

An object is the basic storage entity that represents a file you store in the OpenStack Object Storage system. When you upload data to OpenStack Object Storage, the data is stored as-is (no compression or encryption) and consists of a location (container), the object’s name, and any metadata consisting of key/value pairs.
Objects are the files or directories that are stored within a container (Creating Containers). Uploading objects can be achieved in a number of ways. A simple way is by using the SWIFT CLIENT TOOL. We run this client tool against our OpenStack Identity Service, which has been configured to communicate to our OpenStack Object Storage Proxy Server. This allows us to create, delete, and modify containers and objects in our OpenStack Object Storage environment.

To gain in-depth knowledge and be on par with practical experience, then explore  OpenStack Training course.

Getting started

Log in to a computer or server that has the swift client package installed.

How to achieve it…

Carry out the following steps to upload objects in our OpenStack Object Storage environment:

Uploading objects

Uploading directories

  • Create a directory and two files to upload to our OpenStack Object Storage environment, as follows:


  • To upload directories and their contents, we issue the same command but just specify the directory. The files within the directory are recursively uploaded. We do this as follows:


Uploading multiple objects

We are able to upload a number of objects using a single command. To do this, we simply specify each of them on our command line. To upload our test1 and test2 files, we issue the following command:

Explore OpenStack Sample Resumes! Download & Edit, Get Noticed by Top Employers!  Download Now!

How it works…

Uploading files to our OpenStack Object Storage environment is simple to achieve with the swift client tool. We can upload individual files or complete directories. The syntax is as follows:

Note :

Note that when uploading files, the objects that are created are of the form that we specify to the swift client, including the full paths. For example, uploading

This is because OpenStack Object Storage is not a traditional tree-based hierarchical filesystem that our computers and desktops usually employ, where paths are delimited by a single slash (/ or ). OpenStack Object Storage consists of a flat set of objects that exist in containers where that slash forms the object name itself.


Related Pages:
Openstack Tutorial

Interview Questions:
Openstack Interview Questions

Subscribe For Free Demo

Free Demo for Corporate & Online Trainings. Protection Status