@@ -38,27 +38,35 @@ import a cloud image and turn it into a new template.
3838> - cloud-init installed
3939> - qemu-guest-agent installed
4040
41- 1 . (Optional) Run the ` bin/import-cloud-image ` [ script] ( ./images/cloud_image.html#script ) to import a new cloud image:
41+ 1 . (Optional) Run the ` bin/import-cloud-image ` [ script] ( ./images/cloud_image.html#script ) on your proxmox node to import a new cloud image:
4242
4343``` bash
44- $ import-cloud-image [URL]
44+ $ import-cloud-image [URL] [FILENAME] [VMID] [NET_BRIDGE] [DATASTORE]
45+ # Eg: import-cloud-image https://cdimage.debian.org/images/cloud/bookworm/latest/debian-12-generic-amd64.qcow2 debian12cloud 9000 vmbr0 lvm_local
4546```
4647
47- 2 . Navigate to ` packer/base-clone `
48+ 2 . Navigate to ` packer/base-clone ` on your control node
4849
4950> ** Tip** : Use the ` bin/generate-vars ` script to quickly generate variable files
5051> in ` packer ` and ` terraform ` subdirectories.
5152
52533 . Populate the necessary variables in ` auto.pkrvars.hcl ` :
5354
5455``` hcl
55- proxmox_url = "https://<PVE_IP>:8006/api2/json"
56- proxmox_username = "<user>@pam"
57- proxmox_password = "<password>"
56+ proxmox_url = "https://<PVE_IP>:8006/api2/json"
57+ proxmox_username = "<user>@pam"
58+ proxmox_password = "<password>"
59+ proxmox_node = "node_name" # Visible in the GUI sidebar
60+ proxmox_storage_pool = "<pool_name> # Eg. local_lvm
61+ proxmox_bridge = "<bridge_name>" # Eg. vmbr0
62+
5863
5964clone_vm = "<cloud-image-name>"
6065vm_name = "<new-template-name>"
61- vm_id = 5000
66+ vm_id = 5000 # ID of the template created by packer
67+
68+ ip_address = "<ip_address>"
69+ gateway = "<gateway_address>"
6270
6371ssh_username = "debian"
6472ssh_public_key_path = "/path/to/public/key"
@@ -88,6 +96,7 @@ provider to provision virtual machines from our Packer templates.
8896``` hcl
8997proxmox_ip = "https://<PVE_IP>:8006/api2/json"
9098proxmox_api_token = "<API_TOKEN>"
99+ target_node = "<proxmox_node_name>" # name of the proxmox cluster node to deploy the VM on
91100
92101template_id = 5000
93102ip_gateway = "10.10.10.1"
@@ -117,7 +126,6 @@ clients = [
117126]
118127
119128ssh_user = "debian"
120- ssh_private_key_file = "/path/to/ssh/private/key"
121129ssh_public_key_file = "/path/to/ssh/public/key"
122130```
123131
@@ -169,6 +177,8 @@ $ ansible-inventory --graph --vars
169177> ** Note** : The ` nfs_share_mounts ` variable in ` inventory/group_vars/client.yml `
170178> should be modified or removed if not required
171179
180+ > ** Note** : Check ` ansible/roles/common/defaults/main.yml ` to customize additional settings, like timezone
181+
1721824 . Run the playbook:
173183
174184``` bash
0 commit comments