Quantcast
Viewing all articles
Browse latest Browse all 247559

Re: How to find the storage of a VM in Cloud director

I suppose it would help if I told you how I actually found the disk capacity as well... Image may be NSFW.
Clik here to view.

 

 

The .NET objects do not match up 1:1 with what the API gives us as XML, so in this case it was easier to find it in the XML first, and then figure out where they put it in the .NET object.

 

 

The disk size happens to be in the OVF schema, which is referenced here:

 

http://www.vmware.com/support/vcd/doc/rest-api-doc-1.5-html/types/RasdItemsListType.html

 

which leads you to the XML schema definition:

 

http://schemas.dmtf.org/ovf/envelope/1/dsp8023.xsd

 

and then you can search for "VirtualDisk," which gives you the complex type with the capacity in it. Image may be NSFW.
Clik here to view.

 

 

<xs:complexType name="VirtualDiskDesc_Type">        <xs:annotation>            <xs:documentation>Type for virtual disk descriptor</xs:documentation>        </xs:annotation>        <xs:sequence>            <xs:any namespace="##other" processContents="lax" minOccurs="0"                 maxOccurs="unbounded"/>        </xs:sequence>        <xs:attribute name="diskId" type="xs:string" use="required">            <xs:annotation>                <xs:documentation>Identifier for virtual disk</xs:documentation>            </xs:annotation>        </xs:attribute>        <xs:attribute name="fileRef" type="xs:string" use="optional">            <xs:annotation>                <xs:documentation>Reference to virtual disk content. If not specified a                    blank virtual disk is created of size given by capacity                attribute</xs:documentation>            </xs:annotation>        </xs:attribute>        <xs:attribute name="capacity" type="xs:string" use="required">            <xs:annotation>                <xs:documentation>Virtual disk capacity, can be specified as either an                    xs:long size or as a reference to a property using ${property_name}.                </xs:documentation>            </xs:annotation>        </xs:attribute>        <xs:attribute name="capacityAllocationUnits" type="xs:string" default="byte" use="optional">            <xs:annotation>                <xs:documentation>Unit of allocation for ovf:capacity. If not specified                    default value is bytes. Value shall match a recognized value for the                    UNITS qualifier in DSP0004.</xs:documentation>            </xs:annotation>        </xs:attribute>        <xs:attribute name="format" type="xs:string" use="optional">            <xs:annotation>                <xs:documentation>Format of virtual disk given as a URI that identifies                    the disk type</xs:documentation>            </xs:annotation>        </xs:attribute>        <xs:attribute name="populatedSize" type="xs:long" use="optional">            <xs:annotation>                <xs:documentation>Estimated populated size of disk in                bytes</xs:documentation>            </xs:annotation>        </xs:attribute>        <xs:attribute name="parentRef" type="xs:string" use="optional">            <xs:annotation>                <xs:documentation>Reference to potential parent disk</xs:documentation>            </xs:annotation>        </xs:attribute>        <xs:anyAttribute namespace="##any" processContents="lax"/>    </xs:complexType>

 

 

Once you know how the object is laid out, you can go back to the PowerCLI .NET object and discover where the capacity is fairly easily!


Viewing all articles
Browse latest Browse all 247559

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>