0

I am using OpenStack4J to interact with OpenStack. My goal at this point is simply to launch an instance. I can do this manually using my tenant: rosemend. And when I do this, I have a network called rosemond (Id: a9b097b3-af47-4222-b98e-f1b631f9ec45) that I select and make the instance part of.

However, using OpenStack4J, I am not able to make any progress. OpenStack4j requires a network port that I don't seem to be able to figure out how to set. The call to set this network port would look like:

 serverCreateBuilder.addNetworkPort("0a44eedc-8298-4544-87d7-094c7b34708e")

First I tried the Id of the rosemond network itself (a9b097b3-af47-4222-b98e-f1b631f9ec45). The error message in this case is:

 Port id a9b097b3-af47-4222-b98e-f1b631f9ec45 could not be found.

Next, within OpenStack, when I click on the rosemond network, I see a list of 5 items called ports. I then tried using each of them resulting each in error message:

Port 0a44eedc-8298-4544-87d7-094c7b34708e is still in use.

And when I do not pass a network port at all, I get the error:

It is not allowed to create an interface on external network c6fb539b-2013-405c-903a-4700a00d954b

My question is what is the value I should use here?

Klaus
  • 2,328
  • 5
  • 41
  • 62

2 Answers2

0

I will recommend you to go with JClouds instead. In my opinion is easier to use and the documentation is better.

See my answer in Openstack cloud (identity service, nova service and swift service) vs Java application. There is some sample code in GitHub that you can check.

Community
  • 1
  • 1
Athafoud
  • 2,898
  • 3
  • 40
  • 58
0

1) To create a vm with an existing port, port id is required. 2) The port you use to boot the vm instance must be in DOWN status (Detached). If the port is attached to an instance (active), Openstack will report conflict. For Openstack4j, it throws a ClientResponseException exception with a message: port xxxis still in use.

See https://developer.openstack.org/api-ref/compute/?expanded=create-server-detail