fix qemu-guest-agent problem
This commit is contained in:
13
config.yaml
Normal file
13
config.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
image_url: "https://cloud.centos.org/centos/10-stream/x86_64/images/CentOS-Stream-GenericCloud-x86_64-10-latest.x86_64.qcow2"
|
||||
vm_name: "cloudimg-centos-stream-10"
|
||||
vm_id: 0
|
||||
storage: "local"
|
||||
memory: 1024
|
||||
cores: 1
|
||||
disk_size: "10G"
|
||||
bridge: "vmbr1"
|
||||
vlan_tag: 301
|
||||
proxmox_host: "10.10.26.11"
|
||||
proxmox_user: "root@pam"
|
||||
proxmox_pass: "Pnd77net!"
|
||||
guest_agent: true
|
||||
BIN
proxmox-template
Executable file
BIN
proxmox-template
Executable file
Binary file not shown.
10
proxmox.go
10
proxmox.go
@@ -195,13 +195,21 @@ func createProxmoxVM(config *Config) error {
|
||||
},
|
||||
{"qm", "set", fmt.Sprintf("%d", config.VMID),
|
||||
"--serial0", "socket",
|
||||
"--vga", "serial0",
|
||||
"--vga", "std",
|
||||
},
|
||||
{"qm", "set", fmt.Sprintf("%d", config.VMID),
|
||||
"--ipconfig0", "ip=dhcp",
|
||||
},
|
||||
}
|
||||
|
||||
// Tambahkan ini
|
||||
if config.GuestAgent {
|
||||
commands = append(commands, []string{
|
||||
"qm", "set", fmt.Sprintf("%d", config.VMID),
|
||||
"--agent", "enabled=1",
|
||||
})
|
||||
}
|
||||
|
||||
// Firewall is now handled as part of the network config (buildNetworkConfig),
|
||||
// so no separate "qm set --firewall" command is required here.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user