yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #79944
[Bug 1843708] [NEW] Key-pair is not updated during the rebuild
Public bug reported:
Description
===========
When we want to rebuild an instance and change the keypair we can specified it with :
openstack --os-compute-api-version 2.54 server rebuild --image "Debian 10" --key-name key1 instance1
This comes from this implementation :
https://review.opendev.org/#/c/379128/
https://specs.openstack.org/openstack/nova-specs/specs/queens/implemented/rebuild-keypair-reset.html
But when rebuilding the instance, Cloud-Init will set the key in authorized_keys from
http://169.254.169.254/openstack/latest/meta_data.json
And this meta_data.json uses the keys from instance_extra tables
But the keypair will be updated in the 'instances' table but not in the 'instance_extra' table.
So the keypair is not updated inside the VM
May be this is the function for saving the keypair, but the save() do nothing :
https://opendev.org/openstack/nova/src/branch/master/nova/objects/instance.py#L714
Steps to reproduce
==================
- Deploy a DevStack
- Boot an instance with keypair key1
- Rebuild it with key2
- A nova show will show the key_name key2, keypairs object in table instance_extra is not updated and you cannot connect with key2 to the instance
Expected result
===============
Connecte to the Vm with the new keypair added during the rebuild call
Actual result
=============
The keypair added during the rebuild call is not set in the VM
Environment
===========
I tested it on a Devstack from master and we have the behaviour.
NOVA : commit 5fa49cd0b8b6015aa61b4312b2ce1ae780c42c64
** Affects: nova
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1843708
Title:
Key-pair is not updated during the rebuild
Status in OpenStack Compute (nova):
New
Bug description:
Description
===========
When we want to rebuild an instance and change the keypair we can specified it with :
openstack --os-compute-api-version 2.54 server rebuild --image "Debian 10" --key-name key1 instance1
This comes from this implementation :
https://review.opendev.org/#/c/379128/
https://specs.openstack.org/openstack/nova-specs/specs/queens/implemented/rebuild-keypair-reset.html
But when rebuilding the instance, Cloud-Init will set the key in authorized_keys from
http://169.254.169.254/openstack/latest/meta_data.json
And this meta_data.json uses the keys from instance_extra tables
But the keypair will be updated in the 'instances' table but not in the 'instance_extra' table.
So the keypair is not updated inside the VM
May be this is the function for saving the keypair, but the save() do nothing :
https://opendev.org/openstack/nova/src/branch/master/nova/objects/instance.py#L714
Steps to reproduce
==================
- Deploy a DevStack
- Boot an instance with keypair key1
- Rebuild it with key2
- A nova show will show the key_name key2, keypairs object in table instance_extra is not updated and you cannot connect with key2 to the instance
Expected result
===============
Connecte to the Vm with the new keypair added during the rebuild call
Actual result
=============
The keypair added during the rebuild call is not set in the VM
Environment
===========
I tested it on a Devstack from master and we have the behaviour.
NOVA : commit 5fa49cd0b8b6015aa61b4312b2ce1ae780c42c64
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1843708/+subscriptions
Follow ups
-
[Bug 1843708] Re: [SRU] Key-pair is not updated during the rebuild
From: Launchpad Bug Tracker, 2023-05-31
-
[Bug 1843708] Re: [SRU] Key-pair is not updated during the rebuild
From: Corey Bryant, 2023-05-16
-
[Bug 1843708] Re: [SRU] Key-pair is not updated during the rebuild
From: Edward Hope-Morley, 2023-05-16
-
[Bug 1843708] Re: [SRU] Key-pair is not updated during the rebuild
From: Edward Hope-Morley, 2023-05-16
-
[Bug 1843708] Fix included in openstack/nova rocky-eol
From: OpenStack Infra, 2022-11-11
-
[Bug 1843708] Fix included in openstack/nova queens-eol
From: OpenStack Infra, 2022-11-11
-
[Bug 1843708] Re: Key-pair is not updated during the rebuild
From: Elod Illes, 2020-11-24
-
[Bug 1843708] Re: Key-pair is not updated during the rebuild
From: Elod Illes, 2020-11-24
-
[Bug 1843708] Re: Key-pair is not updated during the rebuild
From: melanie witt, 2020-07-23
-
[Bug 1843708] Re: Key-pair is not updated during the rebuild
From: OpenStack Infra, 2020-07-23