Openstack - How to create a new server in a specific project

1.8k Views Asked by At

I'm relative new to Openstack/Microstack platforms.

I have a Microstack environment with three projects:

  • Two projects that created by default: "admin" and "service".
  • One project that I created in my own: "myProject"

I noticed that when I am creating a new server using Microstack CLI, the server is automatically allocated in the "admin" Project, even if I specified (using --nic port-id) ports that belong to "myProject" project.

In contrast to creating new networks, subnetworks or ports, the command "microstack.openstack server create" have no "--project" flag.

Is there any way to create a new server in "myProject" project using Microstack CLI?

Thanks

1

There are 1 best solutions below

2
On

You need to take on the myProject identity. First, you need a user that has a role in myProject; let's call it myUser.

You can then log on to the GUI as Myuser and you will automatically be in myProject, if this is the only project where this user has a role.

In case myUser has roles in other projects, the GUI has a small menu, by default in the upper left corner, that allows you to switch projects.

On the command line, you need to change a few environment variables, namely OS_USERNAME, OS_PROJECT_NAME and of course OS_PASSWORD, before launching your server. Reference: https://docs.openstack.org/python-openstackclient/pike/cli/authentication.html.