Skip to content

Commit

Permalink
feat: add vhd option (#814)
Browse files Browse the repository at this point in the history
* chore: update bib with vhd azure support

### What does this PR do?

Updates bib that includes the support from osbuild/bootc-image-builder#132

### Screenshot / video of UI

<!-- If this PR is changing UI, please include
screenshots or screencasts showing the difference -->

N/A

### What issues does this PR fix or reference?

<!-- Include any related issues from Podman Desktop
repository (or from another issue tracker). -->

N/A

### How to test this PR?

<!-- Please explain steps to reproduce -->

Images should be like normal

Signed-off-by: Charlie Drage <[email protected]>

* feat: add vhd option

### What does this PR do?

* Adds option for vhd / vpc images to be used on Hyper-V or Azure

### Screenshot / video of UI

<!-- If this PR is changing UI, please include
screenshots or screencasts showing the difference -->

### What issues does this PR fix or reference?

<!-- Include any related issues from Podman Desktop
repository (or from another issue tracker). -->

Closes #799

### How to test this PR?

1. Build a vhd
2. See it completes build correctly.
3. Launch via Hyper-V or Azure / other software

<!-- Please explain steps to reproduce -->

Signed-off-by: Charlie Drage <[email protected]>

---------

Signed-off-by: Charlie Drage <[email protected]>
  • Loading branch information
cdrage authored Sep 10, 2024
1 parent 25e6dce commit 20999e6
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 2 deletions.
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
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

0 comments on commit 20999e6

Please sign in to comment.