After Deprec

openstack_cloud_computing_cookbook

Issue link: https://read.uberflip.com/i/1334488

Contents of this Issue

Navigation

Page 122 of 317

Using OpenStack Storage 112 Uploading objects Objects are the files or directories that are stored within a container. 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 in turn has been configured to communicate to our OpenStack Storage proxy server and allow us to create, delete, and modify containers and objects in our OpenStack Storage environment. Getting ready Log in to a computer or server that has the swift client package installed. How to do it... Carry out the following steps to upload objects into our OpenStack Storage environment: Uploading objects 1. Create a 500 MB file under /tmp as an example file to upload, as follows: dd if=/dev/zero of=/tmp/example-500Mb bs=1M count=500 2. We can upload this file to our OpenStack Storage account using the following command: swift -V 2.0 -A http://172.16.0.1:5000/v2.0/ -U cookbook:demo -K openstack upload test /tmp/example-500Mb When using OpenStack Storage, objects uploaded will be stored with the full path of that object under our container. Although the objects appear to be a regular file system, with a notion of a path structure, OpenStack Storage is not a regular filesystem. Uploading directories Create a directory and two files to upload to our OpenStack Storage environment, as follows: mkdir /tmp/test dd if=/dev/zero of=/tmp/test/test1 bs=1M count=20 dd if=/dev/zero of=/tmp/test/test2 bs=1M count=20 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: swift -V 2.0 -A http://172.16.0.1:5000/v2.0/ -U cookbook:demo -K openstack upload test /tmp/test www.it-ebooks.info

Articles in this issue

Links on this page

Archives of this issue

view archives of After Deprec - openstack_cloud_computing_cookbook