Introduction

Purpose

This is a functional specification of the support added for tags related functionality added to CloudStack's EC2 implementation (awsapi). Also some more fidelity task are covered here.

References

Feature specification

  • Tags Support for EC2:

          CloudStack supports tags for the following resource types: User Vm | Template | ISO | Volume | Snapshot | Guest Network | LB rule | PF rule | Firewall rule | Security Group | Remote Access VPN | Public IP Address

          We can map this support to following AWS EC2 resource types:

  • *# image
    1. instance
    2. snapshot
    3. volume
  • Fix DNS name filter support for DescribeInstances API

API Changes:

A] For Tag Support following new EC2 API's will be supported:

1) ec2-create-tags

CS: CreateTags&ResourceId.1=image:<uuid>&Tag.1.Key=type&Tag.1.Value=linux &Tag.2.Key=inbuilt&Tag.2.Value=true

AWS: ec2-create-tags image:<uuid> --tag type=linux --tag inbuilt=true (CLI)

Parameters

  • ResourceId.n:    ID of the resource to be tagged (required) (format-> resourceType:resourceId) (allowed-values for resourceType-> image, instance, snapshot, volume )
  • Tag.n.Key:           key for a tag (required)
  • Tag.n.Value:       value for a tag (required)

Functionality

  • Adds all the tags provided in the input to every specified resources [0,1,..,n].
  • Tags are a key-value pair. If the value for a tag is to be none then the user needs to set the value with an empty string.
  • For EC2 commands, pass in the ResourceId parameter in the format resourceType:resourceId

2) ec2-describe-tags

CS: DescribeTags&Filter.1.Name=resource-type&Filter.1.Value=image

AWS: ec2-describe-tags --filter resource-type=image (CLI)

Parameters

  • Filter.n.Name:   name of the filter (not-required) (allowed-values: resource-id, resource-type, key, value)
  • Filter.n.Value:   value for the filter (not-required)

Functionality

  • List all tags belonging to the accounts the user is authorized to view.
  • Filters can be used to narrow down the search.

3) ec2-delete-tag

CS: DeleteTags&ResourceId.1=image:<uuid>&Tag.1.Key=type &Tag.2.Key=inbuilt&Tag.2.Value=true

AWS: ec2-delete-tag  image:<uuid> --tag type --tag inbuilt=true (CLI)

Parameters

  • ResourceId.n:    ID of the resource (required) (format-> resourceType:resourceId) (allowed-values for resourceType-> image, instance, snapshot, volume )
  • Tag.n.Key:           tag’s key (required)
  • Tag.n.Value:       tag’s value (not-required)

Functionality

  • Deletes the set of tags mentioned in the input from the specified set of resources.

4) Changes to existing Describe* EC2 API’s  

Following are the Describe APIs whose output has been modified to include the information about the tags associated with the corresponding resource:

DescribeImages, DescribeInstances, DescribeSnapshots, DescribeVolumes

5)Filter support tag-key, tag-value and tag:key

Following existing Describe* EC2 API’s now have filter support for tag-key, tag-value and tag:key filters:

DescribeInstances, DescribeSnapshots, DescribeVolumes

One limitation: For filter tag:key, AWS EC2 API allows an empty value, however CS API cannot filter based on empty values.

B] Fidelity task: Fix dns-name filter for DecsribeInstances API

We plan to add support for the dns-name filter for this EC2 API. We will map the 'name' property of a CS UserVM to the dns-name filter.

  • No labels