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

Add doc to build centos image with DHCP support #602

Merged
merged 1 commit into from
Apr 25, 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 @@ -38,6 +38,7 @@ The typical image workflow comprises of the following steps:
- Advanced scenarios for Qcow2 to ova image conversion - [guide](docs/Advanced%20Scenarios%20for%20Qcow2%20to%20OVA.md)
- How to import image to PowerVS instance from COS - [guide](docs/How%20to%20Import%20Image%20to%20PowerVS%20Instance.md)
- How to upload image to COS bucket using pvsadm - [guide](docs/How%20to%20Upload%20Image%20to%20COS.md)
- How to build DHCP supported centos image - [guide](docs/Build%20DHCP%20enabled%20Centos%20Images.md)

### Samples
Please take a look at the [samples](samples/README.md) folder for end-to-end examples.
Expand Down
32 changes: 32 additions & 0 deletions docs/Build DHCP enabled Centos Images.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Overview

This guide talks about how to build centos image to support DHCP IP and import it to PowerVS workspace.

1. Build the image template
```
pvsadm image qcow2ova --prep-template-default > image-prep.template
```

2. Add the below lines to end of `image-prep.template` file to customize network.
```shell
mkdir -p /etc/cloud/cloud.cfg.d
cat <<EOF >> /etc/cloud/cloud.cfg.d/99-custom-networking.cfg
network: {config: disabled}
EOF
```

3. Build OVA image
```
pvsadm image qcow2ova --image-name <name> --image-dist centos --image-url https://cloud.centos.org/centos/8-stream/ppc64le/images/CentOS-Stream-GenericCloud-8-latest.ppc64le.qcow2 --prep-template image-prep.template
```
Note: Qcow2 CentOS images for ppc64le can be found [here](https://cloud.centos.org/centos/8-stream/ppc64le/images/)


4. Upload image to COS bucket
```
pvsadm image upload -b <bucket-name> -f <file-name> -r <region> --accesskey <access-key-value> --secretkey <secret-key-value>
```
5. Import OVA image to a PowerVS Workspace
```
pvsadm image import -n <service-instance-name> -b <bucket-name> -o <file-name> -r <region> --accesskey <access-key-value> --secretkey <secret-key-value> --pvs-image-name <final-image-name>
```
Loading