Closed Joffrey54 closed 1 year ago
Howdy 🖐 nORKy54 ! Thank you for your interest in this project. We value your feedback and will respond soon.
If you want to contribute to this project, please make yourself familiar with the CONTRIBUTION
guidelines.
Hi @nORKy54 , virtual hardware info is not provided via the API. We'd have to parse it out of the OVF. We have the code to do that and with some refactoring could add the info to govc. In the meantime you could parse it out using library.export:
% govc library.export /Kubernetes/photon*/*.ovf - | grep Disk
<DiskSection>
<Disk ovf:populatedSize="2894921728" ovf:capacityAllocationUnits="byte" ovf:format="http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized" ovf:diskId="vmdisk1" ovf:capacity="17179869184" ovf:fileRef="file1"/>
</DiskSection>
Yes, you can tag library items, for example:
% govc tags.attach tkr-k8s /Kubernetes/photon-3-k8s-v1.22.9---vmware.1-tkg.1.73d1d07
% govc tags.attached.ls tkr-k8s
com.vmware.content.library.Item:02accb0e-25a1-47ed-87ff-0325eb526810
% govc tags.attached.ls -r /Kubernetes/photon-3-k8s-v1.22.9---vmware.1-tkg.1.73d1d07
tkr-k8s
You can also use the xmlstarlet
program to parse disk size like so:
% govc library.export /Kubernetes/photon*/*.ovf - | xml sel -N ovf=http://schemas.dmtf.org/ovf/envelope/1 -t -m /ovf:Envelope/ovf:DiskSection/ovf:Disk -v @ovf:capacity
17179869184
Thanks you !
Hi,
Is it possible to get hardware information about a library item (OVF) ? I need to get disks size. Is is possible to add tag as on a library item (it's possible in the UI) ?
Thanks you