← Back to team overview

openstack team mailing list archive

Re: multi-nic blueprint - data migration


I've written a migration to handle moving the data in the current instances
table mac_address column into the new mac_address table before the column is

I agree with Jay, data should never be discarded when migrating forward. I
don't think there has been a case yet where data is migrated in nova. This
could be the first.


On Mon, Mar 28, 2011 at 8:17 AM, Jay Pipes <jaypipes@xxxxxxxxx> wrote:

> On Mon, Mar 28, 2011 at 2:31 AM, Ishimoto, Ryu <ryu@xxxxxxxxxxx> wrote:
> > Hi All,
> > I was looking at the multi-nic
> > blueprint(https://blueprints.launchpad.net/nova/+spec/nova-multi-nic),
> and
> > in particular:
> > 1) removing mac_address column from the instances table and creating a
> > mac_addresses table. This is for storing which instances own which mac
> > addresses as well as which network each mac is for.
> > What happens(or should happen) to the MAC addresses that are already
> > associated with instances?  Will they be migrated to the new
> mac_addresses
> > table?  Or will they be discarded completely?
> Data should never be discarded in situations like this where a column
> is moved to another table's schema (or to be records in another
> table).
> > I was curious to know how Nova usually handles data migration issues like
> > this.
> No idea whether/if Nova's data migrations have previously needed to
> preserve data in this way. Glance does, however, and you can use the
> following Python changescript to get an idea how to perform this exact
> type of change:
> http://bazaar.launchpad.net/~glance-core/glance/cactus-trunk/view/head:/glance/registry/db/migrate_repo/versions/003_add_disk_format.py
> Note that SQLite has issues if you try to add and drop columns in the
> same changescript and you also have an unrelated column that is
> indexed (see:
> http://code.google.com/p/sqlalchemy-migrate/issues/detail?id=117).
> If this is the case, you will need to write SQL-based changescripts
> specfically for SQLite. You can see examples of how this is
> accomplished in Glance for the same DB version here:
> http://bazaar.launchpad.net/~glance-core/glance/cactus-trunk/view/head:/glance/registry/db/migrate_repo/versions/003_sqlite_upgrade.sql
> http://bazaar.launchpad.net/~glance-core/glance/cactus-trunk/view/head:/glance/registry/db/migrate_repo/versions/003_sqlite_downgrade.sql
> Cheers,
> jay
> _______________________________________________
> Mailing list: https://launchpad.net/~openstack
> Post to     : openstack@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~openstack
> More help   : https://help.launchpad.net/ListHelp

Confidentiality Notice: This e-mail message (including any attached or
embedded documents) is intended for the exclusive and confidential use of the
individual or entity to which this message is addressed, and unless otherwise
expressly indicated, is confidential and privileged information of Rackspace.
Any dissemination, distribution or copying of the enclosed material is prohibited.
If you receive this transmission in error, please notify us immediately by e-mail
at abuse@xxxxxxxxxxxxx, and delete the original message.
Your cooperation is appreciated.