Ask Your Question

shashwat195's profile - activity

2018-06-12 12:50:32 -0600 received badge  Popular Question (source)
2017-03-14 12:47:38 -0600 asked a question Possible strategies for sharing images through ec2api?

My openstack deployment uses the https://github.com/openstack/ec2-api (EC2API) to expose APIs to our customers. Customers don't directly call nova/glance. I want to expose Glance's https://specs.openstack.org/openstack/glance-specs/specs/api/v2/sharing-image-api-v2.html (share-image) API. The 'modify-image-attribute' api, which is how image sharing is normally done in AWS is https://developer.openstack.org/api-ref/ec2-api/ (not supported) in openstack's EC2API. I have no choice but to add code in my EC2API layer.

The problem with 'sharing' any resource is the schema of the ec2api table.

CREATE TABLE items (

id varchar(30) NOT NULL,

project_id varchar(64) DEFAULT NULL,

vpc_id varchar(12) DEFAULT NULL,

os_id varchar(36) DEFAULT NULL,

data text,

PRIMARY KEY (id),

UNIQUE KEY items_os_id_idx (os_id)

) ENGINE=InnoDB DEFAULT CHARSET=utf8

As 'id' is the primary key in the table, I can't really 'share' the image with any other project_id. As this table in referenced in run_instance and many other call's, I can't ignore it. Is there a way around this?