2done.org

Linuxメインなメモ書き。二度寝してから書く。(ご意見は Twitter あたりで。そのうちコメント欄つけます。)

スナップショットの更新をすると Custum Properties が消える

対策不明のため個別記載

スナップショットに対して、glance update または horizon からのアップデートをすると Custum Properties が消える。

それに引きずられ Type が Snapshot から Image に変更される。

この状態だと、スナップショットテーブル以外にイメージテーブルにもスナップショットが表示されるようになってしまう。

初期状態(glance show)

URI: http://172.17.1.6:9292/v1/images/6610096a-3673-4871-ad78-748bca154876
Id: 6610096a-3673-4871-ad78-748bca154876
Public: No
Protected: No
Name: t001snap001a
Status: active
Size: 18677760
Disk format: ami
Container format: ami
Minimum Ram Required (MB): 0
Minimum Disk Required (GB): 0
Owner: a5952a7540ab422bac2554a1def1cbc0
Property 'instance_uuid': c6e0ab5e-7177-43ea-ba9b-a2c3ea5eaf1a
Property 'image_location': snapshot
Property 'image_state': available
Property 'user_id': 0a4b4fb7b8e5487c9ed93c89828e5aee
Property 'image_type': snapshot
Property 'ramdisk_id': 24d196c3-3694-447b-8b5f-9e2a2cde79ca
Property 'kernel_id': 6cb1def1-7ecd-48c4-a0e6-e7a210b77a56
Property 'owner_id': a5952a7540ab422bac2554a1def1cbc0

初期状態(MySQL)

mysql> select * from image_properties where image_id = '6610096a-3673-4871-ad78-748bca154876' order by id;
+-----+--------------------------------------+----------------+--------------------------------------+---------------------+---------------------+------------+---------+
| id  | image_id                             | name           | value                                | created_at          | updated_at          | deleted_at | deleted |
+-----+--------------------------------------+----------------+--------------------------------------+---------------------+---------------------+------------+---------+
| 125 | 6610096a-3673-4871-ad78-748bca154876 | image_type     | snapshot                             | 2012-06-09 07:23:05 | 2012-06-09 07:23:38 | NULL       |       0 |
| 126 | 6610096a-3673-4871-ad78-748bca154876 | instance_uuid  | c6e0ab5e-7177-43ea-ba9b-a2c3ea5eaf1a | 2012-06-09 07:23:05 | 2012-06-09 07:23:38 | NULL       |       0 |
| 127 | 6610096a-3673-4871-ad78-748bca154876 | user_id        | 0a4b4fb7b8e5487c9ed93c89828e5aee     | 2012-06-09 07:23:05 | 2012-06-09 07:23:38 | NULL       |       0 |
| 128 | 6610096a-3673-4871-ad78-748bca154876 | kernel_id      | 6cb1def1-7ecd-48c4-a0e6-e7a210b77a56 | 2012-06-09 07:23:16 | 2012-06-09 07:23:16 | NULL       |       0 |
| 129 | 6610096a-3673-4871-ad78-748bca154876 | image_location | snapshot                             | 2012-06-09 07:23:16 | 2012-06-09 07:23:38 | NULL       |       0 |
| 130 | 6610096a-3673-4871-ad78-748bca154876 | image_state    | available                            | 2012-06-09 07:23:16 | 2012-06-09 07:23:38 | NULL       |       0 |
| 131 | 6610096a-3673-4871-ad78-748bca154876 | ramdisk_id     | 24d196c3-3694-447b-8b5f-9e2a2cde79ca | 2012-06-09 07:23:16 | 2012-06-09 07:23:16 | NULL       |       0 |
| 132 | 6610096a-3673-4871-ad78-748bca154876 | owner_id       | a5952a7540ab422bac2554a1def1cbc0     | 2012-06-09 07:23:16 | 2012-06-09 07:23:38 | NULL       |       0 |
+-----+--------------------------------------+----------------+--------------------------------------+---------------------+---------------------+------------+---------+
8 rows in set (0.00 sec)

スナップショットを更新(glance update)

$ glance update 6610096a-3673-4871-ad78-748bca154876 name='t001snap001a'
Updated image 6610096a-3673-4871-ad78-748bca154876

glance update で更新した後のスナップショットの状態(glance show)

URI: http://172.17.1.6:9292/v1/images/6610096a-3673-4871-ad78-748bca154876
Id: 6610096a-3673-4871-ad78-748bca154876
Public: No
Protected: No
Name: t001snap001a
Status: active
Size: 18677760
Disk format: ami
Container format: ami
Minimum Ram Required (MB): 0
Minimum Disk Required (GB): 0
Owner: a5952a7540ab422bac2554a1def1cbc0

glance update で更新した後のスナップショットの状態(MySQL)

mysql> select * from image_properties where image_id = '6610096a-3673-4871-ad78-748bca154876' order by id;
+-----+--------------------------------------+----------------+--------------------------------------+---------------------+---------------------+------------+---------+
| id  | image_id                             | name           | value                                | created_at          | updated_at          | deleted_at | deleted |
+-----+--------------------------------------+----------------+--------------------------------------+---------------------+---------------------+------------+---------+
| 125 | 6610096a-3673-4871-ad78-748bca154876 | image_type     | snapshot                             | 2012-06-09 07:23:05 | 2012-06-09 07:28:42 | NULL       |       1 |
| 126 | 6610096a-3673-4871-ad78-748bca154876 | instance_uuid  | c6e0ab5e-7177-43ea-ba9b-a2c3ea5eaf1a | 2012-06-09 07:23:05 | 2012-06-09 07:28:42 | NULL       |       1 |
| 127 | 6610096a-3673-4871-ad78-748bca154876 | user_id        | 0a4b4fb7b8e5487c9ed93c89828e5aee     | 2012-06-09 07:23:05 | 2012-06-09 07:28:42 | NULL       |       1 |
| 128 | 6610096a-3673-4871-ad78-748bca154876 | kernel_id      | 6cb1def1-7ecd-48c4-a0e6-e7a210b77a56 | 2012-06-09 07:23:16 | 2012-06-09 07:28:42 | NULL       |       1 |
| 129 | 6610096a-3673-4871-ad78-748bca154876 | image_location | snapshot                             | 2012-06-09 07:23:16 | 2012-06-09 07:28:42 | NULL       |       1 |
| 130 | 6610096a-3673-4871-ad78-748bca154876 | image_state    | available                            | 2012-06-09 07:23:16 | 2012-06-09 07:28:42 | NULL       |       1 |
| 131 | 6610096a-3673-4871-ad78-748bca154876 | ramdisk_id     | 24d196c3-3694-447b-8b5f-9e2a2cde79ca | 2012-06-09 07:23:16 | 2012-06-09 07:28:42 | NULL       |       1 |
| 132 | 6610096a-3673-4871-ad78-748bca154876 | owner_id       | a5952a7540ab422bac2554a1def1cbc0     | 2012-06-09 07:23:16 | 2012-06-09 07:28:42 | NULL       |       1 |
+-----+--------------------------------------+----------------+--------------------------------------+---------------------+---------------------+------------+---------+
8 rows in set (0.00 sec)

Horizon から更新した後のスナップショットの状態(glance show)

$ glance show 6610096a-3673-4871-ad78-748bca154876
URI: http://172.17.1.6:9292/v1/images/6610096a-3673-4871-ad78-748bca154876
Id: 6610096a-3673-4871-ad78-748bca154876
Public: No
Protected: No
Name: t001snap001a
Status: active
Size: 18677760
Disk format: ami
Container format: ami
Minimum Ram Required (MB): 0
Minimum Disk Required (GB): 0
Owner: a5952a7540ab422bac2554a1def1cbc0
Property 'kernel_id': 6cb1def1-7ecd-48c4-a0e6-e7a210b77a56
Property 'ramdisk_id': 24d196c3-3694-447b-8b5f-9e2a2cde79ca

Horizon から更新した後のスナップショットの状態(MySQL)

mysql> select * from image_properties where image_id = '6610096a-3673-4871-ad78-748bca154876' order by id;
+-----+--------------------------------------+----------------+--------------------------------------+---------------------+---------------------+------------+---------+
| id  | image_id                             | name           | value                                | created_at          | updated_at          | deleted_at | deleted |
+-----+--------------------------------------+----------------+--------------------------------------+---------------------+---------------------+------------+---------+
| 125 | 6610096a-3673-4871-ad78-748bca154876 | image_type     | snapshot                             | 2012-06-09 07:23:05 | 2012-06-09 07:30:03 | NULL       |       1 |
| 126 | 6610096a-3673-4871-ad78-748bca154876 | instance_uuid  | c6e0ab5e-7177-43ea-ba9b-a2c3ea5eaf1a | 2012-06-09 07:23:05 | 2012-06-09 07:30:03 | NULL       |       1 |
| 127 | 6610096a-3673-4871-ad78-748bca154876 | user_id        | 0a4b4fb7b8e5487c9ed93c89828e5aee     | 2012-06-09 07:23:05 | 2012-06-09 07:30:03 | NULL       |       1 |
| 128 | 6610096a-3673-4871-ad78-748bca154876 | kernel_id      | 6cb1def1-7ecd-48c4-a0e6-e7a210b77a56 | 2012-06-09 07:23:16 | 2012-06-09 07:28:42 | NULL       |       0 |
| 129 | 6610096a-3673-4871-ad78-748bca154876 | image_location | snapshot                             | 2012-06-09 07:23:16 | 2012-06-09 07:30:03 | NULL       |       1 |
| 130 | 6610096a-3673-4871-ad78-748bca154876 | image_state    | available                            | 2012-06-09 07:23:16 | 2012-06-09 07:30:03 | NULL       |       1 |
| 131 | 6610096a-3673-4871-ad78-748bca154876 | ramdisk_id     | 24d196c3-3694-447b-8b5f-9e2a2cde79ca | 2012-06-09 07:23:16 | 2012-06-09 07:28:42 | NULL       |       0 |
| 132 | 6610096a-3673-4871-ad78-748bca154876 | owner_id       | a5952a7540ab422bac2554a1def1cbc0     | 2012-06-09 07:23:16 | 2012-06-09 07:30:03 | NULL       |       1 |
+-----+--------------------------------------+----------------+--------------------------------------+---------------------+---------------------+------------+---------+
8 rows in set (0.00 sec)