Skip to content

Update message when keys are NOT being injected#3799

Merged
andrijapanicsb merged 6 commits into
masterfrom
update-injectkeys.ssh-message
Jan 18, 2020
Merged

Update message when keys are NOT being injected#3799
andrijapanicsb merged 6 commits into
masterfrom
update-injectkeys.ssh-message

Conversation

@andrijapanicsb
Copy link
Copy Markdown
Contributor

@andrijapanicsb andrijapanicsb commented Jan 9, 2020

Description

When the injectkeys.sh script runs, if the public ssh key is the same as the authorized_keys file inside the extracted systemvm.iso - then the public ssh key files is NOT copied over and the systemvm.iso is not modified - message added to explain just that.

Also, after the injectkeys.sh is run/finished, from the Java code we currently generate a wrong message that the private key has also been injected (we don't inject it, only the public key) - and in general sometimes NOTHING is injected - so changed the messages accordingly.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

How Has This Been Tested?

Restarted the mgmt server for an existing installation, injectkeys.ssh was run, and confirmed that the systemvm.iso is NOT modified, same modification date, same md5sum as before.
Message properly logged in the mgmt logs, as follows:

2020-01-09 22:28:08,777 DEBUG [c.c.s.ConfigurationServerImpl] (main:null) (logid:) Executing: /bin/bash /usr/share/cloudstack-common/scripts/vm/systemvm/injectkeys.sh /var/cloudstack/management/.ssh/id_rsa.pub /var/cloudstack/management/.ssh/id_rsa /usr/share/cloudstack-common/vms/systemvm.iso
2020-01-09 22:28:08,897 DEBUG [c.c.s.ConfigurationServerImpl] (main:null) (logid:) Execution is successful.
2020-01-09 22:28:08,898 DEBUG [c.c.s.ConfigurationServerImpl] (main:null) (logid:) New public key is the same as the one in the systemvm.iso, not injecting it, not modifying systemvm.iso
2020-01-09 22:28:08,898 INFO [c.c.s.ConfigurationServerImpl] (main:null) (logid:) The script injectkeys.sh was run with result : null

@andrijapanicsb andrijapanicsb added this to the 4.14.0.0 milestone Jan 9, 2020
@andrijapanicsb
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@andrijapanicsb a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✖centos6 ✔centos7 ✔debian. JID-563

@apache apache deleted a comment from blueorangutan Jan 9, 2020
@andrijapanicsb
Copy link
Copy Markdown
Contributor Author

@blueorangutan test centos7 vmware-65u2

@blueorangutan
Copy link
Copy Markdown

@andrijapanicsb a Trillian-Jenkins test job (centos7 mgmt + vmware-65u2) has been kicked to run smoke tests

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-742)
Environment: vmware-65u2 (x2), Advanced Networking with Mgmt server 7
Total time taken: 37483 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr3799-t742-vmware-65u2.zip
Smoke tests completed. 78 look OK, 0 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File

@andrijapanicsb
Copy link
Copy Markdown
Contributor Author

2020-01-10 00:06:19,449 DEBUG [c.c.s.ConfigurationServerImpl] (DirectAgent-5:ctx-2e05c809 10.2.2.71, job-1/job-27, cmd: StartCommand) (logid:1686008a) Executing: /bin/bash /usr/share/cloudstack-common/scripts/vm/systemvm/injectkeys.sh /var/cloudstack/management/.ssh/id_rsa.pub /var/cloudstack/management/.ssh/id_rsa /usr/share/cloudstack-common/vms/systemvm.iso
2020-01-10 00:06:19,535 INFO [c.c.s.ConfigurationServerImpl] (DirectAgent-5:ctx-2e05c809 10.2.2.71, job-1/job-27, cmd: StartCommand) (logid:1686008a) The script injectkeys.sh was run with result : null

Looks good.

Copy link
Copy Markdown
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just messages improved. log scrapping might be impacted but in this case it should IMNSHO

@andrijapanicsb andrijapanicsb changed the base branch from master to 4.13 January 13, 2020 22:57
@andrijapanicsb andrijapanicsb changed the base branch from 4.13 to master January 13, 2020 22:58
Copy link
Copy Markdown
Contributor

@nvazquez nvazquez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM

@andrijapanicsb
Copy link
Copy Markdown
Contributor Author

Merging based on 2 x LGMT/approval and automated tests passing, and manual testing (by me).

@andrijapanicsb andrijapanicsb merged commit 9b7acfd into master Jan 18, 2020
ustcweizhou pushed a commit to ustcweizhou/cloudstack that referenced this pull request Feb 28, 2020
* Update message when keys are NOT being injected

* Correct the message after injectkeys.ssh is done

* Update message to a more meaningful one, since sometimes nothing is injected

* Update other 2

* typo
@andrijapanicsb andrijapanicsb deleted the update-injectkeys.ssh-message branch April 3, 2020 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants