CLOUDSTACK-10290: Introduce option to have config drives on primary storage#2651
CLOUDSTACK-10290: Introduce option to have config drives on primary storage#2651yadvr merged 11 commits intoapache:4.11from
Conversation
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
…api is called when VM was running Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
…c key Refactor code Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
|
Work left is some testing around VM migration and unit test/marvin test fixing. |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2061 |
|
@blueorangutan test matrix |
|
@rhtyd a Trillian-Jenkins matrix job (centos6 mgmt + xs71, centos7 mgmt + vmware65, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests |
|
Trillian test result (tid-2682)
|
|
Trillian test result (tid-2683)
|
|
@blueorangutan test centos7 xenserver-71 |
|
@borisstoyanov a Trillian-Jenkins test job (centos7 mgmt + xenserver-71) has been kicked to run smoke tests |
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
| } | ||
|
|
||
| JsonObject metaData = new JsonObject(); | ||
| for (String[] item : vmData) { |
There was a problem hiding this comment.
Can this logic in the FOR loop be extracted to a method?
There was a problem hiding this comment.
To limit my effort scope, code in this class were previously in Nfs resource class. Most of the changes in this class are from a move-refactor. I'll further refactor if I've time, so yes I can try.
| } | ||
|
|
||
| File tmpIsoStore = new File(tempDirName, new File(isoFileName).getName()); | ||
| Script command = new Script("/usr/bin/genisoimage", Duration.standardSeconds(300), LOG); |
There was a problem hiding this comment.
Can this also be extracted into a method?
nvazquez
left a comment
There was a problem hiding this comment.
Code LGTM, just left some minor comments
|
Packaging result: ✔centos6 ✔centos7 ✖debian. JID-2065 |
|
@blueorangutan test |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-2685)
|
|
Trillian test result (tid-2689)
|
|
@blueorangutan test |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-2690)
|
borisstoyanov
left a comment
There was a problem hiding this comment.
I've just run a test and can confirm it uses the primary storage to store the config drive iso, also extracted the iso and open it and it shows the data I've put it, LGTM. Turning the feature on and off also moves the iso to the s/p storage.
|
Based on code reviews and both manual and regression tests. I'll merge this. Further refactorings can be done in a future PR. |
borisstoyanov
left a comment
There was a problem hiding this comment.
I've just did a manual testing on isolated, shared and l2 types of networks. Config drive iso appears on primary containing all the user data configured. I've also performed some lifecycle operations like start/stop, reboot, migrate, reinstall and it works fine. One note is that if the user wants to update userdata on running VM it needs to stop the VM, execute the update userdata API and start the VM. LGTM
|
Merging based on code reviews, test results incl. manual tests. |
…2651) Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This introduces a new global setting
vm.configdrive.primarypool.enabledto toggle creation/hosting of config drive iso files on primary storage, the default will befalsecausing them to be hosted on secondary storage. The support is limited from hypervisor resource side and in current implementation limited to KVM. The next big change is that config drive is created at a temporary location by management server and shipped to either KVM or SSVM agent via cmd-answer pattern, the data of which is not logged in logs. This saves us from addinggenisoimagedependency on cloudstack-agent pkg.The APIs to reset ssh public key, password and user-data (via update VM API) requires that VM should be shutdown. Therefore, in the refactoring I removed the case of updation of existing ISO. If there are objections I'll re-put the strategy to detach+attach new config iso as a way of updation. In the refactored implementation, the folder name is changed to lower-cased
configdrive. And during VM start, migration or shutdown/removal if primary storage is enable for use, the KVM agent will handle cleanup tasks otherwise SSVM agent will handle them.Types of changes
GitHub Issue/PRs
Screenshots (if appropriate):
How Has This Been Tested?
Checklist:
Testing