This is hacky because there are at least three different ways to set the VM's memory.
.spec.template.spec.domain.memory.guest
.spec.instancetype.name
.spec.template.spec.domain.resources.requests.memory
oc get vm -A -o go-template='{{range .items}}{{.metadata.name}}{{"\t"}} {{.status.printableStatus}}{{"\t"}} {{.spec.template.spec.domain.memory.guest}} {{.spec.instancetype.name}}{{"\t"}} {{.spec.template.spec.domain.resources.requests.memory}}{{"\n"}}{{end}}'
rhel-9-amber-limpet-47 Running <no value> u1.medium <no value>
test103 Running <no value> <no value> 8Gi
centos-stream9-bronze-meerkat-50 Stopped 2Gi <no value> <no value>
...
oc get virtualmachineclusterinstancetypes -o go-template='{{range .items}}{{.metadata.name}}{{"\t"}} {{.spec.memory.guest}} {{"\n"}}{{end}}'
cx1.2xlarge 16Gi
cx1.4xlarge 32Gi
...
Probably better to query the virt-launcher pods... Kudos to ChatGPT for helping me create this syntax. Prompt:
help me write a kubectl command that will list all pods using go-template output which includes the memory requests from the container called "compute"
oc get pods -A -l kubevirt.io/domain -o go-template='{{range .items}}{{range .spec.containers}}{{if eq .name "compute"}}{{.resources.requests.memory}}{{end}}{{end}} {{.status.phase}} {{.metadata.namespace}}/{{.metadata.name}}{{"\n"}}{{end}}'
8474Mi Running ansiblenetworking1/virt-launcher-test103-gpbs8
2302Mi Running jcall/virt-launcher-rhel9-lab-net-6r5h4
4565499905 Running project-app1/virt-launcher-fedora-app1-jzkwp
...