A hardware profile describes the size of a virtual machine in a cloud and specifies details such as how many virtual CPUs, how much memory or how much local storage an instance might have. The attributes of a hardware profile consist of a human-readable name and a list of elements. Each element defines possible values along with a sizing dimension.
Since clouds differ sharply in how virtual machine sizing is represented and influenced, hardware profiles provide a generic mechanism to express sizing constraints. For each dimension (such as amount of memory), the hardware profile can express that
When creating a new instance, a client must specify the hardware profile on which the instance is based.
In addition to the sizing constraints, a hardware profile may also indicate the parameters that can be specified by a client in instance operations. A <param>
XML tag signifies the user-defined variable dimensions within the given property. For instance, the following extract shows the memory dimension for a hardware profile that can be specified in the HTTP POST create
operation of the instances collection (i.e. creating a new instance). The given parameter must be specified using the name hwp_memory. The default value is 10240 but the client may specify a value in the range 7680 up to 15360:
... <property kind='range' name='memory' unit='MB' value='10240'> <param href='http://localhost:3003/api/instances' method='post' name='hwp_memory' operation='create' /> <range first='7680.0' last='15360' /> </property> ...
To produce a list of all hardware profiles availaible with this cloud use call GET /api/hardware_profiles. The example below shows how to list the hardware profiles available in the Amazon EC2 cloud. As EC2 provides a set of pre-defined hardware profiles, the properties of each dimension (memory,cpu etc) are the type fixed.
Example request:
GET /api/hardware_profiles?format=xml HTTP/1.1 Authorization: Basic AU1J3UB2121Afd1DdyQWxLaTYTmJMNF4zTXBoRGdhMDh2RUw5ZDAN9zVXVa== User-Agent: curl/7.20.1 (i386-redhat-linux-gnu) Host: localhost:3001 Accept: */*
Server response:
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: 3896 <?xml version='1.0' encoding='utf-8' ?> <hardware_profiles> <hardware_profile href='http://localhost:3001/api/hardware_profiles/t1.micro' id='t1.micro'> <name>t1.micro</name> <property kind='fixed' name='cpu' unit='count' value='1' /> <property kind='fixed' name='memory' unit='MB' value='645.12' /> <property kind='fixed' name='architecture' unit='label' value='i386' /> <property kind='fixed' name='storage' unit='GB' value='160' /> </hardware_profile> <hardware_profile href='http://localhost:3001/api/hardware_profiles/m1.small' id='m1.small'> <name>m1.small</name> <property kind='fixed' name='cpu' unit='count' value='1' /> <property kind='fixed' name='memory' unit='MB' value='1740.8' /> <property kind='fixed' name='architecture' unit='label' value='i386' /> <property kind='fixed' name='storage' unit='GB' value='160' /> </hardware_profile> <hardware_profile href='http://localhost:3001/api/hardware_profiles/m1.large' id='m1.large'> <name>m1.large</name> <property kind='fixed' name='cpu' unit='count' value='4' /> <property kind='fixed' name='memory' unit='MB' value='7680.0' /> <property kind='fixed' name='architecture' unit='label' value='x86_64' /> <property kind='fixed' name='storage' unit='GB' value='850' /> </hardware_profile> <hardware_profile href='http://localhost:3001/api/hardware_profiles/m1.xlarge' id='m1.xlarge'> <name>m1.xlarge</name> <property kind='fixed' name='cpu' unit='count' value='8' /> <property kind='fixed' name='memory' unit='MB' value='15360' /> <property kind='fixed' name='architecture' unit='label' value='x86_64' /> <property kind='fixed' name='storage' unit='GB' value='1690' /> </hardware_profile> <hardware_profile href='http://localhost:3001/api/hardware_profiles/c1.medium' id='c1.medium'> <name>c1.medium</name> <property kind='fixed' name='cpu' unit='count' value='5' /> <property kind='fixed' name='memory' unit='MB' value='1740.8' /> <property kind='fixed' name='architecture' unit='label' value='i386' /> <property kind='fixed' name='storage' unit='GB' value='350' /> </hardware_profile> <hardware_profile href='http://localhost:3001/api/hardware_profiles/c1.xlarge' id='c1.xlarge'> <name>c1.xlarge</name> <property kind='fixed' name='cpu' unit='count' value='20' /> <property kind='fixed' name='memory' unit='MB' value='7168' /> <property kind='fixed' name='architecture' unit='label' value='x86_64' /> <property kind='fixed' name='storage' unit='GB' value='1690' /> </hardware_profile> <hardware_profile href='http://localhost:3001/api/hardware_profiles/m2.xlarge' id='m2.xlarge'> <name>m2.xlarge</name> <property kind='fixed' name='cpu' unit='count' value='6.5' /> <property kind='fixed' name='memory' unit='MB' value='17510.4' /> <property kind='fixed' name='architecture' unit='label' value='x86_64' /> <property kind='fixed' name='storage' unit='GB' value='420' /> </hardware_profile> <hardware_profile href='http://localhost:3001/api/hardware_profiles/m2.2xlarge' id='m2.2xlarge'> <name>m2.2xlarge</name> <property kind='fixed' name='cpu' unit='count' value='13' /> <property kind='fixed' name='memory' unit='MB' value='35020.8' /> <property kind='fixed' name='architecture' unit='label' value='x86_64' /> <property kind='fixed' name='storage' unit='GB' value='850' /> </hardware_profile> <hardware_profile href='http://localhost:3001/api/hardware_profiles/m2.4xlarge' id='m2.4xlarge'> <name>m2.4xlarge</name> <property kind='fixed' name='cpu' unit='count' value='26' /> <property kind='fixed' name='memory' unit='MB' value='70041.6' /> <property kind='fixed' name='architecture' unit='label' value='x86_64' /> <property kind='fixed' name='storage' unit='GB' value='1690' /> </hardware_profile> </hardware_profiles>
To retrieve the details of a specific hardware profile use call GET /api/hardware profiles/:id. The example below shows a request for the m1-large profile of the Deltacloud mock driver. This hardware profile demonstrates the three different types of parameters (fixed, range, enum). Instances launched within this hardware profile will have exactly 2 virtual CPUs, memory in the range 7.5 to 15GB and local storage that can either be 850MB or 1GB. The default value for each dimension is indicated by the value attribute on the property element.
Example request:
GET /api/hardware_profiles/m1-large?format=xml HTTP/1.1 Authorization: Basic bW9ja3VzZXI6bW9ja3Bhc3N3b3Jk User-Agent: curl/7.20.1 (i386-redhat-linux-gnu) Host: localhost:3003 Accept: */*
Server response:
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: 808 <?xml version='1.0' encoding='utf-8' ?> <hardware_profile href='http://localhost:3003/api/hardware_profiles/m1-large' id='m1-large'> <name>m1-large</name> <property kind='fixed' name='cpu' unit='count' value='2' /> <property kind='range' name='memory' unit='MB' value='10240'> <param href='http://localhost:3003/api/instances' method='post' name='hwp_memory' operation='create' /> <range first='7680.0' last='15360' /> </property> <property kind='enum' name='storage' unit='GB' value='850'> <param href='http://localhost:3003/api/instances' method='post' name='hwp_storage' operation='create' /> <enum> <entry value='850' /> <entry value='1024' /> </enum> </property> <property kind='fixed' name='architecture' unit='label' value='x86_64' /> </hardware_profile>