2

My openstack setup is Mitaka version.

I want to list all the Instances with Project Name.

I tried with below command but it shows Tenant ID but not name.

nova list --all-tenants
Gerald Schneider
  • 19,757
  • 8
  • 52
  • 79

2 Answers2

5

The command to list all instances of a project is:

openstack server list --all-projects --project $projectname

The parameter --all-projects is needed to list instances that don't belong to the current project.

Gerald Schneider
  • 19,757
  • 8
  • 52
  • 79
1

There is no way to include projects' names to 'server list' output, so you can just use 'project list' before.

for PROJECT in `openstack project list -c=Name -f=value` ; do echo "$PROJECT" >> server.csv ; openstack server list -c=Name -c=Networks -c=Flavor --status=Active --project $PROJECT --all -f=csv >> server.csv ; done

(--all is the same as --all-projects here)