Hi Martin,
On Sat, Mar 1, 2014 at 12:26 AM, Martin Eppel (meppel) <[email protected]>wrote: > > > Hi Nirmal, > > > > We'd like to propose an enhancement to the current apache stratos cloud > controller to allow the assignment of predefined floating ip when > creating a new instance. > > > Instead of auto assigning the floating ip address from the pool (autoAssignIp > "false" in cartridgeDefinitionBean:iaasProvider, see example below), the > ip address would be predefined in the cartridge definition as an additional > property (see example below with property "floatingIp", ) and if availablein > the floating ip pool,assigned to the instance when it is created. > If the floating ip is unavailable, an exception will be thrown and the > instance will be destroyed. > > > > As for now it would be sufficient to add this enhancement for the > OpenStack provider. > > > > Let me know what you think, and since going forward we would like to > contribute to apache stratos I'd like to use this as an opportunity to get > my feet wet and contribute the necessary changes. > > > > Can you please advise on the process and proper steps to propose and add > an enhancement like this to the project ? > Thanks for the explanation. Currently, at line [1], we are calling IaaS's autoAssignIp method and ask the IaaS to assign an IP to the instance. Similarly, I think you should define a new API operation at [2] and implement that in each of the IaaS providers. If you look at the OpenstackNovaIaas implementation [3], you could see that we call the FloatingIpApi and assign an IP to an instance. In order to get the FloatingIpApi please have a look at line [4]. Now similarly, if you can just add a new operation which takes an IP as an argument and the assign that IP to the instance, that'll do for you. Of course, you need to call this method from [1], once you've implemented it. Please make sure that this addition would not break other IaaS providers. Hope this helps! [1] https://git-wip-us.apache.org/repos/asf?p=incubator-stratos.git;a=blob;f=components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/impl/CloudControllerServiceImpl.java;h=1d773d0968c9916720c61fee0ca9fa6d9b3f9a52;hb=HEAD#l559 [2] https://git-wip-us.apache.org/repos/asf?p=incubator-stratos.git;a=blob;f=components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/interfaces/Iaas.java;h=f45d32e10b0306a9b171ff467bdbaf8668d7035d;hb=HEAD [3] https://git-wip-us.apache.org/repos/asf?p=incubator-stratos.git;a=blob;f=components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/OpenstackNovaIaas.java;h=d0f50e967fd9de6ed647d4e1f83e3e45e06fdc4e;hb=HEAD#l314 [4] https://git-wip-us.apache.org/repos/asf?p=incubator-stratos.git;a=blob;f=components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/OpenstackNovaIaas.java;h=d0f50e967fd9de6ed647d4e1f83e3e45e06fdc4e;hb=HEAD#l219 > > > Thanks > > > > Martin > > > > > > Sample Cartridge definition: > > > > ... > > "iaasProvider": > > [ > > { > > "type": "openstack", > > "imageId": "RegionOne/${IMAGE_ID}", > > "maxInstanceLimit": "4", > > "property": > > [ > > { > > "name": "instanceType", > > "value": "RegionOne/${FLAVOR_ID}" > > }, > > { > > "name": "keyPair", > > "value": "${KEY}" > > }, > > { > > "name": "autoAssignIp", > > "value": "false" > > }, > > { > > "name": "floatingIp", > > "value": "10.10.10.10" > > }, > > { > > "name": "securityGroups", > > "value": "default" > > }, > > { > > "name": "networkInterfaces", > > "value": "net1,net2,net3" > > } > > ] > > } > > ], > > ... > > - > > > -- Best Regards, Nirmal Nirmal Fernando. PPMC Member & Committer of Apache Stratos, Senior Software Engineer, WSO2 Inc. Blog: http://nirmalfdo.blogspot.com/
