Get IP address of new VM started with DHCP
Cheers, is there any way I can have OCCI start a new VM, assign it an IP address using DHCP and tell me (the program which sent the OCCI HTTP request to start a new machine) which address was chosen so that I can later connect to it? Thank you, regards -- Dr. Stefano Ghio - ENG Engineering Italy Website: http://groglogs.blogspot.com/ *If you received this message but you are not its recipient, please ignore it and warn me, thank you.*
Hi Stefano, in the OCCI infrastructure document 2 components for network are specified. Once the network resource which represents a layer 2/3 central component where other resources can be attached to. The resource allows you to specify a network address range and the allocation type for the network (e.g. static/dynamic). Then there is the networkinterface link which allows you to connect any OCCI resource to a OCCI network resource. It allows you to specify mac address, interface name and together with the IPnetworkinterface mixin, you additionally can specify IP address, gateway and allocation (static/dynamic) for this resource. If the implementation supports parsing the IP address from the resource manager (e.g. OpenNebula, OpenStack or others), then you can retrieve it using the occi.networkinterface.address attribute from the networkinterface link (together with the IPnetworkinterface mixin). Even so it might sound a little complicated, this is a very elegant, flexible and for the customer easy to use solution. A GET request for a compute resource with networkinterface may look similar to this:
GET /compute/a9b0bf0a-26f5-11e1-a690-0026b0fffef0 HTTP/1.1 User-Agent: curl/7.21.6 (x86_64-apple-darwin10.7.0) libcurl/7.21.6 OpenSSL/1.0.0e zlib/1.2.5 libidn/1.22 Host: localhost:3000 Accept: */*
< HTTP/1.1 200 OK
< Content-Type: text/plain
< Connection: keep-alive
< Status: 200
< X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.9
< Accept: application/json,text/plain,text/occi
< Server: Ruby OCCI Framework/0.4 OCCI/1.1
< Content-Length: 1209
Category: compute; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind";
X-OCCI-Attribute: occi.core.title=My VM1
X-OCCI-Attribute: occi.core.summary=A short summary
X-OCCI-Attribute: occi.compute.architecture=x64
X-OCCI-Attribute: occi.compute.cores=1
X-OCCI-Attribute: occi.compute.memory=4
X-OCCI-Attribute: occi.compute.state=active
X-OCCI-Attribute: occi.core.id=a9b0bf0a-26f5-11e1-a690-0026b0fffef0
Link: ;rel="http://schemas.ogf.org/occi/core#link";self="/link/networkinterface/a9b0d5c6-26f5-11e1-a690-0026b0fffef0";category="http://schemas.ogf.org/occi/infrastructure#networkinterface,http://schemas.ogf.org/occi/infrastructure/networkinterface#ipnetworkinterface";occi.core.target="/network/a6554290-26f5-11e1-a690-0026b0fffef0";occi.core.source="/compute/a9b0bf0a-26f5-11e1-a690-0026b0fffef0";occi.core.id="a9b0d5c6-26f5-11e1-a690-0026b0fffef0";occi.networkinterface.state="active";occi.networkinterface.mac="00:11:22:33:44:55";occi.networkinterface.interface="eth0";occi.networkinterface.address="192.168.0.2";occi.networkinterface.gateway="192.168.0.1";occi.networkinterface.allocation="dynamic";
Cheers,
Florian
Von: Stefano Ghio
participants (2)
-
florian.feldhaus@tu-dortmund.de
-
Stefano Ghio