When using nova-manage instance_type, it is difficult to change existing instance types. Delete / Create leads to the following issue:
(nova.instance_types): TRACE: Traceback (most recent call last):
(nova.instance_types): TRACE: File "/home/vishvananda/trunk/nova/compute/instance_types.py", line 60, in create
(nova.instance_types): TRACE: rxtx_cap=rxtx_cap))
(nova.instance_types): TRACE: File "/home/vishvananda/trunk/nova/db/api.py", line 1119, in instance_type_create
(nova.instance_types): TRACE: return IMPL.instance_type_create(context, values)
(nova.instance_types): TRACE: File "/home/vishvananda/trunk/nova/db/sqlalchemy/api.py", line 98, in wrapper
(nova.instance_types): TRACE: return f(*args, **kwargs)
(nova.instance_types): TRACE: File "/home/vishvananda/trunk/nova/db/sqlalchemy/api.py", line 2343, in instance_type_create
(nova.instance_types): TRACE: raise exception.DBError(e)
(nova.instance_types): TRACE: DBError: (IntegrityError) (1062, "Duplicate entry 'm1.tiny' for key 'name'") 'INSERT INTO instance_types (created_at, updated_at, deleted_at, deleted, name, memory_mb, vcpus, local_gb, flavorid, swap, rxtx_quota, rxtx_cap) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)' (datetime.datetime(2011, 3, 29, 22, 17, 58, 491739), None, None, False, 'm1.tiny', '512', '1', '0', '9', 0, 0, 0)
(nova.instance_types): TRACE:
The problem is that delete instance type just marks the field deleted, and flavor_id and name are both marked unique. They should either be changed to not unique, or there should be some logic in delete to actaully permanently remove the record instead of just marking it deleted.
there is a way to permanently delete (use the --purge option with $ nova-manage instance_type delete) but it shouldn't stack trace and there should be better output to alert admins to the problem.
I will correct this.