Grab OSType from PVESH

Sep 23, 2022
12
4
8
Hey Everyone,

Working on some reporting needs on a few clusters I have in production and I have a question.

Currently I use


pvesh get /cluster/resources --type vm --output-format json which gets me 90% of what i need, however for Licensing compliance (Microsoft) I'd like to be able to quickly determine if the OSType is Linux or Windows.

I found I can get the ostype data via pvesh get /nodes/nodename/qemu/vmnumber/config but thats on a per VM basis.

Anyway to dump all of that via one command?
 
no currently the ostype is not included in the /cluster/resources api call, only in the individual vm configs
 
Just an idea:


/etc/pve/qemu-server # grep ostype *



/etc/pve/qemu-server # grep ostype *

Code:
100.conf:ostype: l26
101.conf:ostype: l26
102.conf:ostype: l26
103.conf:ostype: l26
104.conf:ostype: other
106.conf:ostype: l26
107.conf:ostype: win11
109.conf:ostype: other
111.conf:ostype: l26
112.conf:ostype: win10
115.conf:ostype: l26
116.conf:ostype: l26
117.conf:ostype: win10
121.conf:ostype: l26
123.conf:ostype: l26
125.conf:ostype: l26
126.conf:ostype: l26
127.conf:ostype: l26
128.conf:ostype: l26
129.conf:ostype: l26
132.conf:ostype: l26
133.conf:ostype: win10
134.conf:ostype: l26
137.conf:ostype: other

Pipe output to a file, iterate over that?
 
Last edited: