update binary
This commit is contained in:
47
README.md
47
README.md
@@ -9,6 +9,8 @@ Tool untuk membuat **template** di Proxmox menggunakan cloud image (Ubuntu, Debi
|
|||||||
- Otomatis create template di Proxmox
|
- Otomatis create template di Proxmox
|
||||||
- Support konfigurasi via CLI flags atau YAML file
|
- Support konfigurasi via CLI flags atau YAML file
|
||||||
- Progress bar untuk download
|
- Progress bar untuk download
|
||||||
|
- **QEMU Guest Agent support** (auto-enable)
|
||||||
|
- **Firewall configuration** (enable/disable)
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
@@ -59,7 +61,9 @@ proxmox-cloud-image \
|
|||||||
-cores 2 \
|
-cores 2 \
|
||||||
-disk-size "20G" \
|
-disk-size "20G" \
|
||||||
-bridge "vmbr0" \
|
-bridge "vmbr0" \
|
||||||
-ssh-key "/root/.ssh/id_rsa.pub"
|
-ssh-key "/root/.ssh/id_rsa.pub" \
|
||||||
|
-guest-agent \
|
||||||
|
-firewall
|
||||||
```
|
```
|
||||||
|
|
||||||
### Auto-find VM ID (mulai dari 10000):
|
### Auto-find VM ID (mulai dari 10000):
|
||||||
@@ -68,11 +72,10 @@ proxmox-cloud-image \
|
|||||||
proxmox-cloud-image \
|
proxmox-cloud-image \
|
||||||
-image-url "https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img" \
|
-image-url "https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img" \
|
||||||
-vm-name "ubuntu-template" \
|
-vm-name "ubuntu-template" \
|
||||||
-proxmox-host "192.168.1.100"
|
-proxmox-host "192.168.1.100" \
|
||||||
|
-guest-agent
|
||||||
```
|
```
|
||||||
|
|
||||||
Kalo `-vm-id` tidak diisi atau diset `0`, tool akan otomatis cari VM ID kosong mulai dari 10000.
|
|
||||||
|
|
||||||
### Dengan VLAN:
|
### Dengan VLAN:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -82,7 +85,9 @@ proxmox-cloud-image \
|
|||||||
-vm-id 9000 \
|
-vm-id 9000 \
|
||||||
-proxmox-host "192.168.1.100" \
|
-proxmox-host "192.168.1.100" \
|
||||||
-bridge "vmbr0" \
|
-bridge "vmbr0" \
|
||||||
-vlan-tag 100
|
-vlan-tag 100 \
|
||||||
|
-guest-agent \
|
||||||
|
-firewall
|
||||||
```
|
```
|
||||||
|
|
||||||
### Menggunakan config file:
|
### Menggunakan config file:
|
||||||
@@ -105,6 +110,9 @@ vlan_tag: 100
|
|||||||
ssh_key: "/root/.ssh/id_rsa.pub"
|
ssh_key: "/root/.ssh/id_rsa.pub"
|
||||||
proxmox_host: "192.168.1.100"
|
proxmox_host: "192.168.1.100"
|
||||||
proxmox_user: "root@pam"
|
proxmox_user: "root@pam"
|
||||||
|
proxmox_pass: ""
|
||||||
|
guest_agent: true
|
||||||
|
firewall: true
|
||||||
```
|
```
|
||||||
|
|
||||||
### Batch mode (multiple templates):
|
### Batch mode (multiple templates):
|
||||||
@@ -162,6 +170,8 @@ proxmox-cloud-image -batch batch.txt
|
|||||||
| `-proxmox-host` | - | IP/hostname Proxmox (required) |
|
| `-proxmox-host` | - | IP/hostname Proxmox (required) |
|
||||||
| `-proxmox-user` | root@pam | Proxmox user |
|
| `-proxmox-user` | root@pam | Proxmox user |
|
||||||
| `-proxmox-pass` | - | Proxmox password |
|
| `-proxmox-pass` | - | Proxmox password |
|
||||||
|
| `-guest-agent` | false | Enable QEMU Guest Agent |
|
||||||
|
| `-firewall` | false | Enable Proxmox firewall |
|
||||||
|
|
||||||
## How It Works
|
## How It Works
|
||||||
|
|
||||||
@@ -171,7 +181,31 @@ proxmox-cloud-image -batch batch.txt
|
|||||||
4. Create VM menggunakan `qm` commands
|
4. Create VM menggunakan `qm` commands
|
||||||
5. Import disk dan configure VM
|
5. Import disk dan configure VM
|
||||||
6. Setup cloud-init
|
6. Setup cloud-init
|
||||||
7. **Convert VM menjadi template** dengan `qm template`
|
7. **Enable QEMU Guest Agent** (jika di-enable)
|
||||||
|
8. **Enable Proxmox firewall** (jika di-enable)
|
||||||
|
9. **Convert VM menjadi template** dengan `qm template`
|
||||||
|
|
||||||
|
## QEMU Guest Agent
|
||||||
|
|
||||||
|
QEMU Guest Agent adalah service yang berjalan di guest OS untuk:
|
||||||
|
- IP address discovery
|
||||||
|
- Graceful shutdown/reboot
|
||||||
|
- File system freeze/thaw
|
||||||
|
- Time synchronization
|
||||||
|
|
||||||
|
Enable dengan flag `-guest-agent` atau di config file:
|
||||||
|
```yaml
|
||||||
|
guest_agent: true
|
||||||
|
```
|
||||||
|
|
||||||
|
## Proxmox Firewall
|
||||||
|
|
||||||
|
Proxmox firewall bisa di-enable untuk template dengan flag `-firewall` atau di config file:
|
||||||
|
```yaml
|
||||||
|
firewall: true
|
||||||
|
```
|
||||||
|
|
||||||
|
Firewall akan di-enable di network interface VM.
|
||||||
|
|
||||||
## Clone Template
|
## Clone Template
|
||||||
|
|
||||||
@@ -190,6 +224,7 @@ qm start 100
|
|||||||
- Pastikan SSH key sudah di-setup untuk passwordless login
|
- Pastikan SSH key sudah di-setup untuk passwordless login
|
||||||
- Image akan di-download ke `/tmp` dan di-upload ke Proxmox
|
- Image akan di-download ke `/tmp` dan di-upload ke Proxmox
|
||||||
- Template tidak bisa di-start, harus di-clone dulu
|
- Template tidak bisa di-start, harus di-clone dulu
|
||||||
|
- QEMU Guest Agent akan otomatis ter-install di guest OS yang support
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
2
main.go
2
main.go
@@ -20,6 +20,8 @@ type Config struct {
|
|||||||
ProxmoxHost string `yaml:"proxmox_host"`
|
ProxmoxHost string `yaml:"proxmox_host"`
|
||||||
ProxmoxUser string `yaml:"proxmox_user"`
|
ProxmoxUser string `yaml:"proxmox_user"`
|
||||||
ProxmoxPass string `yaml:"proxmox_pass"`
|
ProxmoxPass string `yaml:"proxmox_pass"`
|
||||||
|
GuestAgent bool `yaml:"guest_agent"`
|
||||||
|
Firewall bool `yaml:"firewall"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
Reference in New Issue
Block a user