about use agent config ip address all faile

haiwan

Well-Known Member
Apr 23, 2019
249
1
58
37
Hi, we serach all history no found use agent config vm ip addredd.
we use cloud-init config ip is ok. but i no want use cloud-init. issue cluster running HA have remove trouble.
so have people give me guide?
tks
 
Hi,

if I understand you correct you like to set the IP over the Qemu-Guest-Agen?

1.) If so you have to install qemu-guest-agent in the VM.
2.) Then you can use the qemu-guest-agent over the API[1] or CLI[2].
with the exec command you can hand over a command inside the VM.


1.) https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/qemu/{vmid}/agent/exec
2.) https://pve.proxmox.com/pve-docs/pv...ng_qm_strong_qemu_kvm_virtual_machine_manager
tks,
wolfgang
i look other people history use this and base64 encode.
so
{"execute": "guest-exec", "arguments": {"input-data": "OmlwIGFkZHJlc3MgYWRkIGFkZHJlc3M9MTkyLjE2OC4wLjEvMjQgaW50ZXJmYWNlPWV0aGVyMTs=" ,"capture-output": true } }

and it works
this is equal to
:ip address add address=192.168.0.1/24 interface=ether1; eg base64 encode this and send as your input
 
Hi,

if I understand you correct you like to set the IP over the Qemu-Guest-Agen?

1.) If so you have to install qemu-guest-agent in the VM.
2.) Then you can use the qemu-guest-agent over the API[1] or CLI[2].
with the exec command you can hand over a command inside the VM.


1.) https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/qemu/{vmid}/agent/exec
2.) https://pve.proxmox.com/pve-docs/pv...ng_qm_strong_qemu_kvm_virtual_machine_manager
hi, engineer. have wish give me a demo.
use qm agent exec vmid .....
tks
 
Hi,

if I understand you correct you like to set the IP over the Qemu-Guest-Agen?

1.) If so you have to install qemu-guest-agent in the VM.
2.) Then you can use the qemu-guest-agent over the API[1] or CLI[2].
with the exec command you can hand over a command inside the VM.


1.) https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/qemu/{vmid}/agent/exec
2.) https://pve.proxmox.com/pve-docs/pv...ng_qm_strong_qemu_kvm_virtual_machine_manager
hi ,
wolfgang
i wish get your guide. forexample centos7 use exec config ip address demo.
tks.
 
The configuration of a CentOS is not part of Proxmox VE

Here is the command from the host, how a command is executed in a VM on which qemu-guest-agent is installed.

Code:
qm guest exec <VMID> -- <Commad inside VM>
 
The configuration of a CentOS is not part of Proxmox VE

Here is the command from the host, how a command is executed in a VM on which qemu-guest-agent is installed.

Code:
qm guest exec <VMID> -- <Commad inside VM>
tks ,
wolfgang

i see have this guide.
Hookscripts
You can add a hook script to VMs with the config property hookscript.
qm set 100 -hookscript local:snippets/hookscript.pl
It will be called during various phases of the guests lifetime. For an example and documentation see the example script under /usr/share/pve-docs/examples/guest-example-hookscript.pl.

i see have hookscripts. so we plan use qemu agent config vm ip address forexample centos7 windows 2016. so this hookscripts how to write? i wish get a config ip demo. now we have running cloud-inint in centos ok, but windows faile config ip address.
 
The guest configuration has nothing to do with Proxmox VE.
 
tks, wolfgang. now we have all use cloud-init running successful. we just try use qemu same work config ip address. en just this, tks
Hello, may I ask if your Win7 was modified through cloud init or qemu guest agent? thanks