Skip to content
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
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ To create a qcow2 template that is modified to contain certain programs. This is

## Usage

The following command will create a qcow2 image at 'output-archlinux/golden-arch.qcow2' and create a template with VM ID 9000.
This repo uses the [playbook.yml](https://github.com/Naman1997/arch-cloud-image/blob/main/playbook.yml) file in the root directory to create the golden image. In case you want to install any additional tools or make any changes, make sure to modify that file. The playbook installs a list of packages that are present in the [pkglist.txt](https://github.com/Naman1997/arch-cloud-image/blob/version/http/pkglist.txt) file that you can modify as well.

The following command will create a qcow2 image at `output-archlinux/golden-arch.qcow2` and create a template with ID `9000`.
This command assumes that you'll be using the same public key to ssh into the proxmox node as well as the VMs created by the template to keep things simple.

WARNING: If a VM/Template has ID 9000, then these commands will destroy and replace it with the golden image template for proxmox.
WARNING: If a VM/Template has ID `9000`, then these commands will destroy and replace it with the golden image template for proxmox.

```
make -s template \
Expand All @@ -25,15 +27,25 @@ make -s template \
PATH_TO_PUB_KEY=<your_path_to_pub_key>
```
```
#Example
#Example [Make sure you're able to ssh in the proxmox node using the key provided here]
make -s template \
CLOUD_USER=arch \
PROXMOX_USERNAME=root \
PROXMOX_IP=192.168.0.100 \
PATH_TO_PUB_KEY=~/.ssh/id_rsa.pub
```

To use the created template [ID 9000], create a clone using it and attempt to ssh into the VM using user as CLOUD_USER.
To use the created template ID `9000`, create a clone using it and attempt to ssh into the VM using user as CLOUD_USER.

![Creating a Full Clone](images/clone.png)

You will be able to see the IP address of the VM once it boots up as long as you didn't remove the installation of `qemu-guest-agent` from the ansible playbook.

![A cloned node](images/ip.png)

Once the node is up and running, you can use the SSH key you provided to log in the node.

![SSH Login](images/login.png)

## Cleanup

Expand Down
4 changes: 2 additions & 2 deletions archlinux.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ packer {
required_plugins {
qemu = {
source = "github.com/hashicorp/qemu"
version = "~> 1"
version = ">= 1.1.1"
}
ansible = {
source = "github.com/hashicorp/ansible"
version = "~> 1"
version = ">= 1.1.3"
}
}
}
Expand Down
Binary file added images/clone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.