-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MTV-1388 | Add dynamic way to specify the virt-customize
Issue: Right now all the run/firstboot scripts are located inside the conversion pod. To get new scripts to the users we need some alternative way to allow users to specify the scripts themselves. This will speed up the migration process as the users won't need to wait for the build and release of the patch. Additionally, the users themselves can tweak the scripts depending on their needs. Design: We have two options use the config maps, mount it to the container and read the mounted directory depending on their name we do virt-customize with them. An alternative solution would be to create CRD with all configurations such as `action`, `path` etc. I have chosen first as this is needed as soon as possible. User flow: 1. The user needs to create a config map inside the namespace where they want to migrate the VM. The config map needs to be named `mtv-virt-customize`. 2. Inside the configmap user can specify data with key/value definition. The value is script itself which they want to run. The key needs to follow regex `^([0-9]+_win_firstboot(([\w\-]*).ps1))$` or `^([0-9]+_linux_(run|firstboot)(([\w\-]*).sh))$` depending on where the customer wants the script to run. For example `00_win_firstboot_test.ps1` will specify that the data should be interpreted as PowerShell script which should start at boot. Alternatively, the Linux option has not only the `firstboot` but also the `run` option. This will be applied on the VM after virt-v2v conversion, but before the VM is started. Note: The number in the begining of the key sets the order. Conversion pod flow: 1. The `forklift-controller` checks if there is a config map inside the namespace. If the config map is present it is automatically mounted to the conversion pod at `/mnt/dynamic_scripts`. 2. The conversion pod checks if the `/mnt/dynamic_scripts` directory is present and if it is, it checks the files and their regexes. Depending on the VM operating system it will use different. From the filename the conversion pod determines the action required on the `virt-customize` step. Additional changes: - I have moved the static variables into a single file as we are using more and more and it's hard to keep track. - New batch file which will run all PowerShell scripts inside the windows first boot scripts dir. Signed-off-by: Martin Necas <[email protected]>
- Loading branch information
Showing
16 changed files
with
245 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.