Juju resource map

Registered by Jorge Castro

Provider-agnostic descriptions of what a given cloud provides, intersects with constraints

== Comment ==
This has been re-targeted for uds-r. Is there expected different outcome from the session held at uds-q? -- Daviey

Blueprint information

Robbie Williamson
Ubuntu Server
Needs approval
William Reade
Series goal:
Milestone target:
Completed by
Antonio Rosales


Etherpad from discussion at UDS-Q:

- Propose format/features to juju mailing list
We have a simple/beautiful way to map what images exist in EC2, but it's specific to EC2
 - https://cloud-images.ubuntu.com/query
 - currently we hardcode a lot of data, we want to extend this for other providers and even private clouds
The problem to solve:
 - You want a platform-agnostic charm, but the charm will have some requirements (say, kernel version/package version/network support)
   - but we have no way of knowing which providers provide those resources via API queries at the moment
   - Resource map is the solution, but many providers
 == Resources we are mapping ==
 * cpu
  - "what is a cpu?" or core?
  - "# Cores" or "# of concurrent threads" ?
  - ECU is a rough measurement that is at least repeatable, "CPU" is harder to define.
 * ram
  - kind/speed of memory?
  - swap amount? (some providers have 0 swap, eg older OpenVZ)
 * storage
 * cost
  - instance cost is clear usually (flat price per hour)
    - spot instances, etc mess with this though
  - bandwidth costs? (often on sliding scales...)
  - storage costs?
  - can get very thorny and JuJu will have no way of knowing the precise marginal cost
 * HVM?
 * GPU
  - is there an "ECU" equivalent for GPUs?
 * EBS
 * software-level stuff (Ubuntu version etc)
== Current Python expression for EC2 ==
_InstanceType = namedtuple("_InstanceType", "arch cpu mem cost hvm")
    # t1.micro cpu is "up to 2", but in practice "very little"
    "t1.micro": _InstanceType(_EITHER_ARCH, 0.1, 613, 0.02, False),
    "m1.small": _InstanceType(_EITHER_ARCH, 1, 1740, 0.08, False),
    "m1.medium": _InstanceType(_EITHER_ARCH, 2, 3840, 0.16, False),
    "m1.large": _InstanceType("amd64", 4, 7680, 0.32, False),
    "m1.xlarge": _InstanceType("amd64", 8, 15360, 0.64, False),
    "m2.xlarge": _InstanceType("amd64", 6.5, 17510, 0.45, False),
    "m2.2xlarge": _InstanceType("amd64", 13, 35020, 0.9, False),
    "m2.4xlarge": _InstanceType("amd64", 26, 70040, 1.8, False),
    "c1.medium": _InstanceType(_EITHER_ARCH, 5, 1740, 0.165, False),
    "c1.xlarge": _InstanceType("amd64", 20, 7168, 0.66, False),
    "cc1.4xlarge": _InstanceType("amd64", 33.5, 23552, 1.3, True),
    "cc2.8xlarge": _InstanceType("amd64", 88, 61952, 2.4, True),
    # also has fancy GPUs we can't currently describe
    "cg1.4xlarge": _InstanceType("amd64", 33.5, 22528, 2.1, True)}
 == Desire ==
User/third party can provide thier own resource maps as well
 - needed for custom charms and private clouds, eg you could have an arbitrary resource like "secure machines in my data center"
Resource map as a file downloaded from a URL
 - make an extensible file format (eg YAML) and allow user to provide his own extensions to the resource map (eg to describe his private cloud, or describe new resources he cares about)
 - would be nice to have user-provided custom URL (or rather additional URLs) to give new information/extensions to information.
 == API ==
 - It would be nice if we could build the resource map by querying APIs directly. OpenStack we can query easily (or modify the API if needed), EC2 we don't really have control over.
 - Could we expect a third party to provide
 - libcloud API queries might be useful here


Work Items

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.