Ask Your Question
0

Use Glance to backup Images in Nova to Swift

asked 2011-09-08 05:57:22 -0600

chaupv79 gravatar image

Hi Everybody,

I have all Nova, Swift and Glance installed successfully to my machines.

And I also configured Glance to use swift. I have 3 images running on Nova. they are stored in /var/lib/nova/buckets/my_bucket/

I call my first Machine that installed Nova (scheduler, network, compute,..) is Cloud Controller.

In my second Machine, I have installed Swift and Glance. in here I configured Glance to use swift.

=>

I am due to backup my images in Cloud Controller to Swift by using Glance. But I couldn't figure out how to start it.

Could Anybody help me?

Thank in advance.

edit retag flag offensive close merge delete

8 answers

Sort by ยป oldest newest most voted
0

answered 2011-09-09 01:47:20 -0600

chaupv79 gravatar image

Thank Jay - The Man Power ,

Below is my glance-api.conf and glance-aip.log

---------------------------glance-api.conf----------------------------------------- [DEFAULT]

Show more verbose log output (sets INFO log level output)

verbose = True

Show debugging output in logs (sets DEBUG log level output)

debug = True

Which backend store should Glance use by default is not specified

in a request to add a new image to Glance? Default: 'file'

Available choices are 'file', 'swift', and 's3'

default_store = swift

Address to bind the API server

bind_host = 0.0.0.0

Port the bind the API server to

bind_port = 9292

Address to find the registry server

registry_host = 0.0.0.0

Port the registry server is listening on

registry_port = 9191

Log to this file. Make sure you do not set the same log

file for both the API and registry servers!

log_file = /var/log/glance/api.log

Send logs to syslog (/dev/log) instead of to file specified by log_file

use_syslog = False

============ Filesystem Store Options ========================

Directory that the Filesystem backend store

writes image data to

filesystem_store_datadir = /var/lib/glance/images/

============ Swift Store Options =============================

Address where the Swift authentication service lives

swift_store_auth_address = https://127.0.0.1:8080/auth/v1.0/

User to authenticate against the Swift authentication service

swift_store_user = test:tester

Auth key for the user authenticating against the

Swift authentication service

swift_store_key = testing

Container within the account that the account should use

for storing images in Swift

swift_store_container = glance

Do we create the container if it does not exist?

swift_store_create_container_on_put = True

Whether to use ServiceNET to communicate with the Swift storage servers.

(If you aren't RACKSPACE, leave this False!)

#

To use ServiceNET for authentication, prefix hostname of

swift_store_auth_address with 'snet-'.

Ex. https://example.com/v1.0/ -> https://snet-example.com/v1.0/

swift_enable_snet = False

============ S3 Store Options =============================

Address where the S3 authentication service lives

s3_store_host = 127.0.0.1:8080/v1.0/

User to authenticate against the S3 authentication service

s3_store_access_key = <20-char AWS access key>

Auth key for the user authenticating against the

S3 authentication service

s3_store_secret_key = <40-char AWS secret key>

Container within the account that the account should use

for storing images in S3. Note that S3 has a flat namespace,

so you need a unique bucket name for your glance images. An

easy way to do this is append your AWS access key to "glance".

S3 buckets in AWS must be lowercased, so remember to lowercase

your AWS access key if you use it in your bucket name below!

s3_store_bucket = <lowercased 20-char="" aws="" access="" key="">glance

Do we create the bucket if it does not exist?

s3_store_create_bucket_on_put = False

============ Image Cache Options ========================

image_cache_enabled = False

Directory that the Image Cache writes data to

Make sure this is also set in glance-pruner.conf

image_cache_datadir = /var/lib/glance/image-cache/

Number of seconds after which we should consider an incomplete image to be

stalled and eligible for reaping

image_cache_stall_timeout = 86400

============ Delayed Delete Options =============================

Turn on/off delayed delete

delayed_delete = False

[pipeline:glance-api] pipeline = versionnegotiation context apiv1app

To enable Image Cache Management API replace pipeline with below:

pipeline = versionnegotiation imagecache apiv1app ...

(more)
edit flag offensive delete link more
0

answered 2011-09-14 17:12:39 -0600

jaypipes gravatar image

Hi again,

So, I actually don't see anything in your log file that indicates any requests have been made to Glance. Have you used the glance CLI tool to add images to Glance?

-jay

edit flag offensive delete link more
0

answered 2011-09-15 02:29:11 -0600

chaupv79 gravatar image

HI Jay,

Thank you for your feedback,

I am sure I have used CLI tool to add images to Glance

glance index --host=192.168.0.15

ID Name Disk Format Container Format Size


3 ubuntu-10-10-server-glance-add raw ovf 58 2 My Image raw ovf 12 1 My Image raw ovf 12

when I check the gegistry.conf, I see the image information as below, the log looks like a sql statement for the images:

2011-08-31 15:13:39 INFO [glance.registry.db.migration] Upgrading sqlite:////var/lib/glance/glance.sqlite to version latest 2011-08-31 15:13:39 INFO [migrate.versioning.api] 0 -> 1... 2011-08-31 15:13:39 INFO [glance.registry.db.migrate_repo.schema] creating table images 2011-08-31 15:13:39 INFO [migrate.versioning.api] done 2011-08-31 15:13:39 INFO [migrate.versioning.api] 1 -> 2... 2011-08-31 15:13:39 INFO [glance.registry.db.migrate_repo.schema] creating table image_properties 2011-08-31 15:13:39 INFO [migrate.versioning.api] done 2011-08-31 15:13:39 INFO [migrate.versioning.api] 2 -> 3... 2011-08-31 15:13:39 INFO [migrate.versioning.api] done 2011-08-31 15:13:39 INFO [migrate.versioning.api] 3 -> 4... 2011-08-31 15:13:39 INFO [migrate.versioning.api] done 2011-08-31 15:13:39 INFO [migrate.versioning.api] 4 -> 5... 2011-08-31 15:13:39 INFO [migrate.versioning.api] done 2011-08-31 15:13:39 INFO [migrate.versioning.api] 5 -> 6... 2011-08-31 15:13:39 INFO [migrate.versioning.api] done 2011-08-31 15:13:39 INFO [migrate.versioning.api] 6 -> 7... 2011-08-31 15:13:39 INFO [migrate.versioning.api] done 2011-08-31 15:13:41 INFO [sqlalchemy.engine.base.Engine.0x...1f2c] PRAGMA table_info("images") 2011-08-31 15:13:41 INFO [sqlalchemy.engine.base.Engine.0x...1f2c] () 2011-08-31 15:13:41 INFO [sqlalchemy.engine.base.Engine.0x...1f2c] PRAGMA table_info("image_properties") 2011-08-31 15:13:41 INFO [sqlalchemy.engine.base.Engine.0x...1f2c] () 2011-08-31 15:13:41 INFO [sqlalchemy.engine.base.Engine.0x...1f2c] PRAGMA table_info("images") 2011-08-31 15:13:41 INFO [sqlalchemy.engine.base.Engine.0x...1f2c] () 2011-08-31 15:13:41 INFO [sqlalchemy.engine.base.Engine.0x...1f2c] PRAGMA table_info("image_properties") 2011-08-31 15:13:41 INFO [sqlalchemy.engine.base.Engine.0x...1f2c] () 2011-08-31 15:14:35 INFO [sqlalchemy.engine.base.Engine.0x...efec] PRAGMA table_info("images") 2011-08-31 15:14:35 INFO [sqlalchemy.engine.base.Engine.0x...efec] () 2011-08-31 15:14:35 INFO [sqlalchemy.engine.base.Engine.0x...efec] PRAGMA table_info("image_properties") 2011-08-31 15:14:35 INFO [sqlalchemy.engine.base.Engine.0x...efec] () 2011-08-31 15:14:35 INFO [sqlalchemy.engine.base.Engine.0x...efec] PRAGMA table_info("images") 2011-08-31 15:14:35 INFO [sqlalchemy.engine.base.Engine.0x...efec] () 2011-08-31 15:14:35 INFO [sqlalchemy.engine.base.Engine.0x...efec] PRAGMA table_info("image_properties") 2011-08-31 15:14:35 INFO [sqlalchemy.engine.base.Engine.0x...efec] () 2011-08-31 15:19:08 INFO [sqlalchemy.engine.base.Engine.0x...1f2c] BEGIN 2011-08-31 15:19:08 INFO [sqlalchemy.engine.base.Engine.0x...1f2c] INSERT INTO images (created_at, updated_at, deleted_at, deleted, name, disk_format, container_format, size, status, is_public, location, checksum, owner) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) 2011-08-31 15:19:08 INFO [sqlalchemy.engine.base ...

(more)
edit flag offensive delete link more
0

answered 2011-09-15 05:19:27 -0600

chaupv79 gravatar image

Thank Jay,

your request for log file make me suddenly come up with an idea, I replace bind_host = 0.0.0.0 and registry_host = 0.0.0.0

by bind_host = 192.168.0.15 registry_host = 192.168.0.15

192.168.0.15 is my host IP address.

and now, glance can put images to swift successfully. I absolutely download images in swift server.

but i got another issue, it is the Nova and Swift

My purpose is to use Swifts' Images in Nova. I am making question how Nova could recognize Swifts' Images.

I am eager to hear your Idea, Jay!!!!!!!

Thank You.

edit flag offensive delete link more
0

answered 2011-09-08 19:25:03 -0600

jaypipes gravatar image

Hi!

Can you paste the output of your glance-api log and glance-api.conf please? Remember to remove any confidential security creds...

Thanks, jay

edit flag offensive delete link more
0

answered 2011-09-15 05:17:39 -0600

chaupv79 gravatar image

Thank Jay,

your request for log file make me suddenly come up with an idea, I replace bind_host = 0.0.0.0 and registry_host = 0.0.0.0

by host = 192.168.0.15 host = 192.168.0.15

192.168.0.15 is my host IP address.

and now, glance can put images to swift successfully. I absolutely download images in swift server.

but i got another issue, it is the Nova and Swift

My purpose is to use Swifts' Images in Nova. I am making question how Nova could recognize Swifts' Images.

I am eager to hear your Idea, Jay!!!!!!!

Thank You.

edit flag offensive delete link more
0

answered 2011-09-15 15:56:04 -0600

jaypipes gravatar image

OK, good to know the first issue was resolved easily! :)

As for using images in Swift to boot in Nova, you need to specify the Glance image URI for the imageRef property of the create server request:

http://docs.openstack.org/trunk/opens...

Cheers! jay

edit flag offensive delete link more
0

answered 2011-09-22 04:29:42 -0600

chaupv79 gravatar image

Thank Jay,

I am due to make xml manifest to test this.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2011-09-08 05:57:22 -0600

Seen: 220 times

Last updated: Sep 22 '11