-
Notifications
You must be signed in to change notification settings - Fork 594
[OSPP]feature:Automated installation using kickstart #23094
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
happy-game
wants to merge
25
commits into
yunionio:master
Choose a base branch
from
happy-game:feature/implement-autoinstall
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[OSPP]feature:Automated installation using kickstart #23094
happy-game
wants to merge
25
commits into
yunionio:master
from
happy-game:feature/implement-autoinstall
Conversation
This file contains hidden or 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
- Add kickstart-related parameters to `/servers` - Implement basic validation
- Add corresponding options for server creation via climc
- Add `GetDetailsKickstart` to query configuration - Add CLI commands to set, get, and delete kickstart configurations
The kickstart process requires extracting kernel files (e.g., `initrd`, `vmlinuz`) from the ISO to customize QEMU boot parameters. This change mounts the ISO to a temporary directory to enable this. Cleanup of the temporary mount directory is also needed, but is not implemented yet and is planned for a future update.
Add kickstart automation support for VM creation with the following steps: 1. Mount installation ISO to /tmp directory 2. Use initramfs and vmlinuz from mount path for qemu args 3. Inject kernel boot parameters with autoinstall configuration 4. Start VM to execute automated installation Modified `guestLauncher` script to handle kernel parameters with spaces that were previously truncated by the Python script.
Add serial port monitoring to host component for tracking Kickstart auto-installation status. Guest VMs can send status messages to host via `/dev/ttyS0` for Kickstart status synchronization. Monitor automatically starts when VM metadata indicates kickstart status is 'pending' or 'installing'.
Automatically update status when kickstart monitor recive `KICKSTART_(SUCCESS|FAILED)`
- Remove function MountISOToTmp used only here, inline the logic - Change mount point to /tmp/kickstart-iso-%ISO_ID - Reuse existing mount if already mounted
- Unmount mount points used for kernel and initramfs - Restart server via Region API Avoid using QMP restart as it's an internal VM restart that doesn't regenerate qemu parameters through cloudpods startup flow, which would trigger auto-installation again
02cc7dc
to
d6be91b
Compare
Create dedicated serial log files in /tmp for Kickstart instead of using /dev/pts/xx. Using /dev/pts/xx causes the host to receive SIGHUP and stop when the master end of the serial port terminates(VM stop).
ba26f17
to
9d5553a
Compare
Adds the `VM_METADATA_KICKSTART_TYPE` to distinguish between kickstart configurations passed by URL or by direct content.
- Set status to installing when machine successfully boots for kickstart - Handle KICKSTART_INSTALLING serial message to update status
- Add size limits for kickstart config content (64KB) and URL (2KB) - Validate URL content size validation via HTTP HEAD request (64KB) - Add URL format validation (HTTP/HTTPS schemes only)
Embed the provided config content as a file in a labeled ISO (mkisofs), then mount the ISO during the Kickstart installation to supply the config.
This commit integrates Kickstart state management into the VM status instead of the previous metadata-based approach, with the following changes: - add VM_KICKSTART_* and VM_KICKSTART_STATUS to manage kickstart status - remove kickstart status related metadata - add kickstart_completed_flag metadata, skip when completed flag is set; - set kickstart_installing and start serial monitor on boot - switch KICKSTART_SUCCESS to KICKSTART_COMPLETED
Place the configuration ISO and the temporary mount for extracting the kernel and initramfs images into /tmp/kickstart/$server_id/
adjust log levels and remove unnecessary log entries
ed0cc81
to
a137316
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
目的
Cloudpods 目前支持创建虚机并且挂载 ISO 镜像,但不支持虚机启动时通过 kickstart 自动化安装 ISO 镜像。需要开发支持创建虚机流程中注入 kickstart 脚本到 cloudpods 元数据中,启动虚机时添加 kickstart 自动化安装 ISO 镜像相关 QEMU 参数,并且兼容主流的操作系统。
关联
OSPP项目
开发要求
开发进度
kickstart
相关参数kickstart
相关metadata
CLI
命令kickstart
自动化安装kickstart
时在创建虚拟机时挂载安装镜像到/tmp
文件夹URL
传递kickstart
参数kickstart
参数