SNP Guest Launch for Fedora and Ubuntu#25
Conversation
Updated snp docs to launch various unique guest using unique values of GUEST_NAME and HOST_SSH_PORT environment variables. Signed-off-by: Harika Nittala <lnittala@amd.com>
Improve the speed of SNP guest creation through the download of the guest base os image once and re-use the same base image for SNP guest creation process for multiple guests. Signed-off-by: Harika Nittala <lnittala@amd.com>
Signed-off-by: Harika Nittala <lnittala@amd.com>
Users can launch multiple SNP enabled guests at the same time via the export of the GUEST_NAME and HOST_SSH_PORT env. variables For the launch of multiple SNP guest at the same time, modified snp.sh to create a separate guest user directory and point the launch working directory to point the current specific guest user directory. Signed-off-by: Harika Nittala <lnittala@amd.com>
Creates guest seed image containing user configured metadata and userdata via genisoimage utility in ubuntu as genisoimage utility is available across different OS distrubutions (cloud-localds utility is supported only in Ubuntu OS) Signed-off-by: Harika Nittala <lnittala@amd.com>
Modified guest cloud-init userdata and metadata to apply the guest configuration details across different OS linux distros(Ubuntu, Fedora, etc) successfuly during SNP guest launch. Signed-off-by: Harika Nittala <lnittala@amd.com>
Modified the structure of SNP guest launch process in ubuntu to standardize the SNP guest launch feature across various OS linux distros. Observed successful launch of SNP guest in ubuntu 22.04. Signed-off-by: Harika Nittala <lnittala@amd.com>
Updated fedora dependencies for guest seed image creation to apply user configuration data on fedora image via genisoimage utility Added support for the SNP guest launch on Fedora 38 host Signed-off-by: Harika Nittala <lnittala@amd.com>
| GUEST_PASS="${GUEST_PASS:-amd}" | ||
| GUEST_SSH_KEY_PATH="${GUEST_SSH_KEY_PATH:-${LAUNCH_WORKING_DIR}/${GUEST_NAME}-key}" | ||
| GUEST_ROOT_LABEL="${GUEST_ROOT_LABEL:-cloudimg-rootfs}" | ||
| GUEST_ROOT_LABEL="${GUEST_ROOT_LABEL:-""}" |
There was a problem hiding this comment.
CLOUD_INIT_IMAGE_URL_UBUNTU="https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img"
IMAGE_BASENAME_UBUNTU=$(basename "${CLOUD_INIT_IMAGE_URL_UBUNTU}")
GUEST_ROOT_LABEL_UBUNTU="root"
IMAGE="${IMAGE:-${LAUNCH_WORKING_DIR}/${GUEST_NAME}.img}"
CLOUD_INIT_IMAGE_URL_FEDORA=""https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/38/Cloud/x86_64/images/Fedora-Cloud-Base-38-1.6.x86_64.qcow2"
| # Set the guest OS image-cloud init URL based on the Host OS type | ||
| case ${linux_distro} in | ||
| ubuntu) | ||
| CLOUD_INIT_IMAGE_URL="https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img" |
There was a problem hiding this comment.
CLOUD_INIT_IMAGE_URL=${CLOUD_INIT_IMAGE_URL_UBUNTU}
There was a problem hiding this comment.
IMAGE_BASENAME=${IMAGE_BASENAME_UBUNTU}
There was a problem hiding this comment.
IMAGE_BASENAME=$(basename "${CLOUD_INIT_IMAGE_URL}")
| ;; | ||
| fedora) | ||
| CLOUD_INIT_IMAGE_URL="https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/38/Cloud/x86_64/images/Fedora-Cloud-Base-38-1.6.x86_64.qcow2" | ||
| ;; |
There was a problem hiding this comment.
CLOUD_INIT_IMAGE_URL=${CLOUD_INIT_IMAGE_URL_FEDORA}
| SETUP_WORKING_DIR="${SETUP_WORKING_DIR:-${WORKING_DIR}/setup}" | ||
| LAUNCH_WORKING_DIR="${LAUNCH_WORKING_DIR:-${WORKING_DIR}/launch}" | ||
| GUEST_NAME="${GUEST_NAME:-snp-guest}" | ||
| LAUNCH_WORKING_DIR="${LAUNCH_WORKING_DIR:-${WORKING_DIR}/launch/${GUEST_NAME}}" |
There was a problem hiding this comment.
LAUNCH_WORKING_DIR="${LAUNCH_WORKING_DIR:-${WORKING_DIR}/launch}"
Add command line option for separate user guest name
--guest_name Specify different guest name
|
|
||
| # Download the guest os-image and change name | ||
| if [ ! -f "${BASE_CLOUD_IMAGE}" ]; then | ||
| wget "${CLOUD_INIT_IMAGE_URL}" -O "${BASE_CLOUD_IMAGE}" |
There was a problem hiding this comment.
wget "${CLOUD_INIT_IMAGE_URL}" -O "${LAUNCH_WORKING_DIR}/IMAGE_BASENAME_UBUNTU"
There was a problem hiding this comment.
Fedora Guest Launch Feature with clean commit history and code cleanup is tracked in the:
fedora-snp-guest-launch-support branch
I will update this PR once the other PR's are addressed
This PR performs following tasks: