nova rebuild
usage: nova rebuild [--password <password>] <server> <image>
Currently the image (rootfs) is replaced but not the kernel (and ramdisk if applicable).
The objective is to make libvirt use the correct kernel and ramdisk associated with the image in glance.
Steps to reproduce:
1. Rebuild a good instance to a new image.
2. Check that the console output has received the keys (like a normal nova boot).
3. Use the credentials of the original instance such as the ssh keys and the floating ip and try to ssh into the instance.
4. Check that the rootfs is correctly rebuilt (cat /etc/issue).
5. Check that the kernel is as expected (uname -r).
I reproduced this issue in devstack installed folsom. Created a Vm with Cirros image and after that tried to rebuild the instance using ami-tty image.
Then the output is as follows:
After first boot with Cirros image:
$ cat /etc/issue
login as 'cirros' user. default password: 'cubswin:)'. use 'sudo' for root.
$uname -r
3.0.0-12-virtual
After rebuilt with ami-tty image:
# bash
bash-4.1# uname -r
3.0.0-12-virtual
bash-4.1# cat /etc/issue
ttylinux ver 12.1 [atheling]
x86_64 class \s kernel \r (\l)
The initial "root" and "user" password is "password".
The database entries are as follows:
image_ref is pointing to new image ID and kernel and ramdisk are pointing to old ones as follows:
mysql> select id, image_ref, kernel_id, ramdisk_id, server_name, vm_state from instances;
+----+--------------------------------------+--------------------------------------+--------------------------------------+-------------+----------+
| id | image_ref | kernel_id | ramdisk_id | server_name | vm_state |
+----+--------------------------------------+--------------------------------------+--------------------------------------+-------------+----------+
| 1 | c4dd8ed5-9488-44f8-98c3-34bcf6cdd52d | b438e614-630e-4bf7-b907-4e4165b32408 | 04a1326f-0891-4b10-8861-61df279d9b40 | NULL | active |
+----+--------------------------------------+--------------------------------------+--------------------------------------+-------------+----------+
1 row in set (0.00 sec)
mysql> Bye
root@ubuntu28folsom:~# nova image-list
+--------------------------------------+---------------------------------+--------+--------+
| ID | Name | Status | Server |
+--------------------------------------+---------------------------------+--------+--------+
| 583282f0-3f79-49ff-9886-97c2a1a3cd3c | cirros-0.3.0-x86_64-uec | ACTIVE | |
| b438e614-630e-4bf7-b907-4e4165b32408 | cirros-0.3.0-x86_64-uec-kernel | ACTIVE | |
| 04a1326f-0891-4b10-8861-61df279d9b40 | cirros-0.3.0-x86_64-uec-ramdisk | ACTIVE | |
| c4dd8ed5-9488-44f8-98c3-34bcf6cdd52d | disk123 | ACTIVE | |
| 5fab96d5-cc2d-4d81-86cc-825885380c12 | kernel | ACTIVE | |
| 5962333b-376e-4d6f-8938-39fff085f7eb | ram | ACTIVE | |
+--------------------------------------+---------------------------------+--------+--------+
root@ubuntu28folsom:~# nova list
+--------------------------------------+--------+--------+------------------+
| ID | Name | Status | Networks |
+--------------------------------------+--------+--------+------------------+
| 80f72970-7131-4426-9a44-7075b290af3e | imgsrv | ACTIVE | private=10.0.0.2 |
+--------------------------------------+--------+--------+------------------+
root@ubuntu28folsom:~# nova show 80f72970-7131-4426-9a44-7075b290af3e
+------------------------+----------------------------------------------------------+
| Property | Value |
+------------------------+----------------------------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-STS:power_state | 1 |
| OS-EXT-STS:task_state | None |
| OS-EXT-STS:vm_state | active |
| accessIPv4 | |
| accessIPv6 | |
| config_drive | |
| created | 2012-10-03T17:32:06Z |
| flavor | m1.tiny (1) |
| hostId | ebf6015593d45f07c808e7868e03b8a14359f41196b8105f66dbd443 |
| id | 80f72970-7131-4426-9a44-7075b290af3e |
| image | disk123 (c4dd8ed5-9488-44f8-98c3-34bcf6cdd52d) |
| key_name | siri |
| metadata | {} |
| name | imgsrv |
| private network | 10.0.0.2 |
| progress | 0 |
| security_groups | [{u'name': u'default'}] |
| status | ACTIVE |
| tenant_id | 81a600396e5c4d07b07772363d1ddf95 |
| updated | 2012-10-03T17:38:36Z |
| user_id | d4418ce0c6524435ba4901fefe394193 |
+------------------------+----------------------------------------------------------+
root@ubuntu28folsom:~#
Nova rebuild command works like this:
nova rebuild
usage: nova rebuild [--password <password>] <server> <image>
Currently the image (rootfs) is replaced but not the kernel (and ramdisk if applicable).
The objective is to make libvirt use the correct kernel and ramdisk associated with the image in glance.
Steps to reproduce:
1. Rebuild a good instance to a new image.
2. Check that the console output has received the keys (like a normal nova boot).
3. Use the credentials of the original instance such as the ssh keys and the floating ip and try to ssh into the instance.
4. Check that the rootfs is correctly rebuilt (cat /etc/issue).
5. Check that the kernel is as expected (uname -r).
I reproduced this issue in devstack installed folsom. Created a Vm with Cirros image and after that tried to rebuild the instance using ami-tty image.
Then the output is as follows:
After first boot with Cirros image:
$ cat /etc/issue
login as 'cirros' user. default password: 'cubswin:)'. use 'sudo' for root.
$uname -r
3.0.0-12-virtual
After rebuilt with ami-tty image:
# bash
bash-4.1# uname -r
3.0.0-12-virtual
bash-4.1# cat /etc/issue
ttylinux ver 12.1 [atheling]
x86_64 class \s kernel \r (\l)
The initial "root" and "user" password is "password".
The database entries are as follows: ------- ------- ------- ------- ------- --+---- ------- ------- ------- ------- ------+ ------- ------- ------- ------- ------- ---+--- ------- ---+--- ------- + ------- ------- ------- ------- ------- --+---- ------- ------- ------- ------- ------+ ------- ------- ------- ------- ------- ---+--- ------- ---+--- ------- + 9488-44f8- 98c3-34bcf6cdd5 2d | b438e614- 630e-4bf7- b907-4e4165b324 08 | 04a1326f- 0891-4b10- 8861-61df279d9b 40 | NULL | active | ------- ------- ------- ------- ------- --+---- ------- ------- ------- ------- ------+ ------- ------- ------- ------- ------- ---+--- ------- ---+--- ------- +
image_ref is pointing to new image ID and kernel and ramdisk are pointing to old ones as follows:
mysql> select id, image_ref, kernel_id, ramdisk_id, server_name, vm_state from instances;
+----+-
| id | image_ref | kernel_id | ramdisk_id | server_name | vm_state |
+----+-
| 1 | c4dd8ed5-
+----+-
1 row in set (0.00 sec)
mysql> Bye lsom:~# nova image-list ------- ------- ------- ------- ----+-- ------- ------- ------- ------- ---+--- -----+- ------- + ------- ------- ------- ------- ----+-- ------- ------- ------- ------- ---+--- -----+- ------- + 3f79-49ff- 9886-97c2a1a3cd 3c | cirros- 0.3.0-x86_ 64-uec | ACTIVE | | 630e-4bf7- b907-4e4165b324 08 | cirros- 0.3.0-x86_ 64-uec- kernel | ACTIVE | | 0891-4b10- 8861-61df279d9b 40 | cirros- 0.3.0-x86_ 64-uec- ramdisk | ACTIVE | | 9488-44f8- 98c3-34bcf6cdd5 2d | disk123 | ACTIVE | | cc2d-4d81- 86cc-825885380c 12 | kernel | ACTIVE | | 376e-4d6f- 8938-39fff085f7 eb | ram | ACTIVE | | ------- ------- ------- ------- ----+-- ------- ------- ------- ------- ---+--- -----+- ------- + lsom:~# nova list ------- ------- ------- ------- ----+-- ------+ ------- -+----- ------- ------+ ------- ------- ------- ------- ----+-- ------+ ------- -+----- ------- ------+ 7131-4426- 9a44-7075b290af 3e | imgsrv | ACTIVE | private=10.0.0.2 | ------- ------- ------- ------- ----+-- ------+ ------- -+----- ------- ------+ lsom:~# nova show 80f72970- 7131-4426- 9a44-7075b290af 3e ------- ------- ----+-- ------- ------- ------- ------- ------- ------- ------- ------- + ------- ------- ----+-- ------- ------- ------- ------- ------- ------- ------- ------- + STS:power_ state | 1 | STS:task_ state | None | 03T17:32: 06Z | 7c808e7868e03b8 a14359f41196b81 05f66dbd443 | 7131-4426- 9a44-7075b290af 3e | 9488-44f8- 98c3-34bcf6cdd5 2d) | 7b07772363d1ddf 95 | 03T17:38: 36Z | 5ba4901fefe3941 93 | ------- ------- ----+-- ------- ------- ------- ------- ------- ------- ------- ------- + lsom:~#
root@ubuntu28fo
+------
| ID | Name | Status | Server |
+------
| 583282f0-
| b438e614-
| 04a1326f-
| c4dd8ed5-
| 5fab96d5-
| 5962333b-
+------
root@ubuntu28fo
+------
| ID | Name | Status | Networks |
+------
| 80f72970-
+------
root@ubuntu28fo
+------
| Property | Value |
+------
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-
| OS-EXT-
| OS-EXT-STS:vm_state | active |
| accessIPv4 | |
| accessIPv6 | |
| config_drive | |
| created | 2012-10-
| flavor | m1.tiny (1) |
| hostId | ebf6015593d45f0
| id | 80f72970-
| image | disk123 (c4dd8ed5-
| key_name | siri |
| metadata | {} |
| name | imgsrv |
| private network | 10.0.0.2 |
| progress | 0 |
| security_groups | [{u'name': u'default'}] |
| status | ACTIVE |
| tenant_id | 81a600396e5c4d0
| updated | 2012-10-
| user_id | d4418ce0c652443
+------
root@ubuntu28fo