Launch Instance via REST API for different Tenant
Our software communicates with OpenStack via REST API. It connects to OpenStack with the 'admin' credentials and the tenant 'admin'. These are provided by the users of the software.
It launches an instance by posting
http://192.168.111.126:8774/v2/5e3618646b1b40b5b612c195983411c1/servers (http://192.168.111.126:8774/v2/5e3618...)
{
"server" : {
"name" : "tenant-rest-demo",
"imageRef" : "cc254ae5-57ee-41fa-9253-1113855434d4",
"flavorRef" : "1",
"personality" : [ ],
"metadata" : { },
"networks" : [ ],
"security_groups" : [ ],
"config_drive" : false
}
}
However, it launches the instance for tenant 'admin'.
Is there a way to launch an instance for a different tenant, say the 'demo' tenant?
The REST API documentation for creating a server http://developer.openstack.org/api-ref-compute-v2.1.html#createServer (http://developer.openstack.org/api-re...) says that there is the option 'tenant_id':
Parameter Style Type Description
tenant_id URI csapi:UUID
The UUID of the tenant in a multi-tenancy cloud.
{
"server" : {
"tenant_id" : "f2bb14e9dd18418db415c89d554949bf",
"name" : "tenant-rest-demo4",
"imageRef" : "cc254ae5-57ee-41fa-9253-1113855434d4",
"flavorRef" : "1",
"personality" : [ ],
"metadata" : { },
"networks" : [ ],
"security_groups" : [ ],
"config_drive" : false
}
}
But it did not help.
Also, it looks that Horizon uses the same REST API to launch instances. I'm able to launch an instance there for a different tenant.
Any comments would be appreciated.
Thank you, Andrei