How to export images? for backup

Asked by Hugo Kou

As title , Thinking about the backup of images.

Assume that glance host is complete dead , include the hard driver.

How can I restore image ?

And another condition is , while I want to provide same image of two different zones.... Is there any exist approach to do that?

I plan to build two zones like the diagram on my blog
http://hugokuo-hugo.blogspot.com/2011/06/method-of-web-service-halb-in-openstack.html

Q1.
Could two zones using one Glance+OBJ ?? Glance+OBJ+Volume controller

Q2.
If I want to back up glance , the method is to backup sqlite file and /var/lib/glance/images ?

Thanks
Hugo Kuo

Question information

Language:
English Edit question
Status:
Answered
For:
Glance Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

This question was reopened

Revision history for this message
Jay Pipes (jaypipes) said :
#1

Hi Hugo! I'll try answering each of your questions inline below. :)

On Wed, Jun 22, 2011 at 12:21 AM, Hugo Kou
<email address hidden> wrote:
> Assume that glance host is complete dead , include the hard driver.
>
> How can I restore image?

The two Glance servers (API and registry) have different strategies for backup.

For the registry server, you will want to set up a MySQL or PostgreSQL
replicated database server. Then, "restoring" the registry server
would be:

a) Failover the actual registry database to the standby
b) Start up a glance-registry instance on a new node, pointing at the
standby/backup database

For the API server, the restore process depends on which backend
storage adapter you use. For real production use, I recommend using
the Swift storage backend, which provides highly-available storage
that can withstand one or more storage nodes going completely down.
When running an HA storage backend like Swift, you only need to spin
up a new glance-api server somewhere and point your clients to the
(possibly) new IP/port address of the new glance-api server.

If you are using the filesystem backend storage adapter in Glance (the
default one), and the disk that images are being written to goes down,
you don't have many choices UNLESS you have backed up the disk
somewhere else, in which case you would restore the backed-up disk (or
directory where the filesystem backend stores images (controlled by
the filesystem_store_datadir config option).

> And another condition is , while I want to provide same image of two different zones.... Is there any exist approach to do that?

Stand up a Glance server that both zones can query. Typically, you'd
want to stand up a separate Glance server for "golden" or base images,
and expose these images for users to reference when they initially
start instances.

> I plan to build two zones like the diagram on my blog
> http://hugokuo-hugo.blogspot.com/2011/06/method-of-web-service-halb-in-openstack.html
>
> Q1.
> Could two zones using one Glance+OBJ ??      Glance+OBJ+Volume controller

They could, yes. Especially if the Glance server was backed by Swift.

> Q2.
> If I want to back up glance , the method is to backup sqlite file and /var/lib/glance/images ?

As mentioned above, don't use SQLite for any production use. You will
want to use MySQL or PostgreSQL and use the related replication
technology (MySQL replication or Slony, for example) to do backups for
your registry database.

Hope this helps!
jay

Revision history for this message
Hugo Kou (tonytkdk) said :
#2

Hello Jay...

I love your explanation , learned so much concept and knowledge in this QA post.
I'll follow your suggestion for our nova deployment.

An additional question of Glance

Currently , the Glance version is 2011.3~bzr122-0ubuntu0ppa1~natty1 in our deployment.
I have to build another cloud to replace exist one. But how could I get same version in this moment? I used to install trunk version before:<
New reversion database seems do not match to 2011.3~bzr122-0ubuntu0ppa1~natty1...
Is there any way to migrate images from exist to another?

Thanks
Hugo

Revision history for this message
Jay Pipes (jaypipes) said :
#3

On Fri, Jul 8, 2011 at 2:51 AM, Hugo Kou
<email address hidden> wrote:
> An additional question of Glance
>
> Currently , the Glance version is 2011.3~bzr122-0ubuntu0ppa1~natty1 in our deployment.
> I have to build another cloud to replace exist one. But how could I get same version in this moment? I used to install trunk version before:<
> New reversion database seems do not match to 2011.3~bzr122-0ubuntu0ppa1~natty1...
> Is there any way to migrate images from exist to another?

Just to make sure I understand, are you asking how to migrate the
registry database, or how to migrate where the images are stored in
the backend?

-jay

Revision history for this message
Hugo Kou (tonytkdk) said :
#4

Hello Jay

thanks for your patient first.

DB : sqlite , /var/lib/glance/glance.sqlite

The reversion is 2011.3~bzr122-0ubuntu0ppa1~natty1

While I change to
 2011.3~d3~20110701.151-0ubuntu0ppa1~natty1

Copy /var/lib/glance/glance.sqlite and /var/lib/glance/images from older version to new version.

Failed to start up glance-registry service.

The problem is on DB , So that I guess the point is on DB tables already changed between these two version

Is there any way to migrate exist images from old version to the new one ?

Thanks

Revision history for this message
Jay Pipes (jaypipes) said :
#5

Ah! Sorry, I was a bit confused.... yes, you should be able to run:

glance-manage db_sync

And that should take care of it.

Cheers!
jay

On Fri, Jul 8, 2011 at 9:26 AM, Hugo Kou
<email address hidden> wrote:
> Question #162300 on Glance changed:
> https://answers.launchpad.net/glance/+question/162300
>
>    Status: Solved => Open
>
> Hugo Kou is still having a problem:
> Hello Jay
>
> thanks for your patient first.
>
> DB : sqlite , /var/lib/glance/glance.sqlite
>
> The reversion is 2011.3~bzr122-0ubuntu0ppa1~natty1
>
> While I change to
>  2011.3~d3~20110701.151-0ubuntu0ppa1~natty1
>
> Copy /var/lib/glance/glance.sqlite  and /var/lib/glance/images from
> older version to new version.
>
> Failed to start up glance-registry service.
>
> The problem is on DB , So that I guess the point is on DB tables already
> changed between these two version
>
> Is there any way to migrate exist images from old version to the new one
> ?
>
> Thanks
>
> --
> You received this question notification because you are a member of
> Glance Core, which is an answer contact for Glance.
>

Can you help with this problem?

Provide an answer of your own, or ask Hugo Kou for more information if necessary.

To post a message you must log in.