Skip to content
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

feat: add vhd option #814

Merged
merged 2 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ Go from a [bootc](https://containers.github.io/bootc/) compatible derived contai
* `raw`: RAW disk image an MBR or GPT partition table
* `anaconda-iso`: Unattended installation method (USB sticks / install-on-boot)
* `vmdk`: Usable in vSphere
* `vhd`: Virtual Hard Disk

The list above is what is supported by the underlying `bootc-image-builder` technology. The list can [be found here](https://github.com/osbuild/bootc-image-builder?tab=readme-ov-file#-image-types).

Expand Down
1 change: 1 addition & 0 deletions docs/vm_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ There are **many** solutions to deploy a virtual machine image and this document
* `anaconda-iso`: BalenaEtcher is recommended for writing unattended ISO installer files to storage devices to create bootable media. It's user-friendly and cross-platform. [Download balenaEtcher](https://www.balena.io/etcher/).
* `vmdk`: VMware Workstation and VMware ESXi are two prominent platforms that support the VMDK format. They provide comprehensive tools for running and managing virtual machines. [VMware Workstation](https://www.vmware.com/products/workstation-pro.html), [VMware ESXi](https://www.vmware.com/products/esxi-and-esx.html).
* `ami`: Amazon EC2 uses the AMI format to launch new virtual servers. You can manage AMIs using Amazon's own tools like AWS Management Console. [Amazon EC2](https://aws.amazon.com/ec2/).
* `vhd`: Usable on multiple applications such as Microsoft Hyper-V and Azure.

## Recommended Development & Testing

Expand Down
2 changes: 2 additions & 0 deletions packages/backend/src/build-disk-image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ export async function buildExists(folder: string, types: BuildType[]) {
imageName = 'vmdk/disk.vmdk';
} else if (type === 'anaconda-iso') {
imageName = 'bootiso/disk.iso';
} else if (type === 'vhd') {
imageName = 'vpc/disk.vhd';
}

const imagePath = resolve(folder, imageName);
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
// Image related
export const bootcImageBuilder = 'bootc-image-builder';
export const bootcImageBuilderCentos =
'quay.io/centos-bootc/bootc-image-builder:sha256-516b2ec3feef2c960e7deb13d0c7d50a13a5f56215cae74ead3de860717d0d63';
'quay.io/centos-bootc/bootc-image-builder:sha256-8ef91986f03df5607a829a819aa35cf704727609f7656edc413c6e4d145293d1';
export const bootcImageBuilderRHEL = 'registry.redhat.io/rhel9/bootc-image-builder:9.4';
6 changes: 6 additions & 0 deletions packages/frontend/src/Build.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,12 @@ export function goToHomePage(): void {
on:click={e => updateBuildType('ami', e.detail)}>
Amazon Machine Image (*.ami)
</Checkbox>
<Checkbox
checked={buildType.includes('vhd')}
title="vhd-checkbox"
on:click={e => updateBuildType('vhd', e.detail)}>
Virtual Hard Disk (*.vhd)
</Checkbox>
</div>
</div>
<div>
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/models/bootc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* SPDX-License-Identifier: Apache-2.0
***********************************************************************/

export type BuildType = 'qcow2' | 'ami' | 'raw' | 'vmdk' | 'anaconda-iso';
export type BuildType = 'qcow2' | 'ami' | 'raw' | 'vmdk' | 'anaconda-iso' | 'vhd';

export interface BootcBuildInfo {
id: string;
Expand Down
2 changes: 1 addition & 1 deletion tests/playwright/src/bootc-extension.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ test.describe('BootC Extension', () => {
imageBuildFailed = false;
});

const types = ['QCOW2', 'AMI', 'RAW', 'VMDK', 'ISO'];
const types = ['QCOW2', 'AMI', 'RAW', 'VMDK', 'ISO', 'VHD'];

for (const type of types) {
test.describe.serial('Building images ', () => {
Expand Down