Issue link: https://read.uberflip.com/i/1334488
Chapter 3 75 4. To use euca2ools, we create the EC2 credentials in OpenStack Identity Service separately. In order to do this, we use Nova Client to create our X509 certificates that euca2tools relies on. To do this, we ensure we have sourced in the details, as shown earlier, and then run the following command: nova x509-get-root-cert nova x509-create-cert 5. We can now create our EC2 credentials using the ec2-credentials-create option. Note that if the environment resource file (for example, /home/user/ keystonerc) has been sourced into the environment, this will conflict with the SERVICE_TOKEN and SERVICE_ENDPOINT environment variables as user/password authentication takes precedence. 6. Clear your environment before setting the following environment variables: export ENDPOINT=172.16.0.1 export SERVICE_TOKEN=ADMIN export SERVICE_ENDPOINT=http://${ENDPOINT}:35357/v2.0 # Get the demo user ID USER_ID=$(keystone user-list | awk '/\ demo\ / {print $2}') # Get the cookbook tenant ID TENANT_ID=$(keystone tenant-list | awk '/\ cookbook\ / {print $2}') # Create the EC2 Credentials keystone ec2-credentials-create --user $USER_ID --tenant_id $TENANT_ID 7. We then take the output from the ec2-credentials-create option to populate an ec2rc file with the following, replacing the EC2_ACCESS_KEY and EC2_SECRET_KEY with the corresponding information from the output: NOVA_API_HOST=172.16.01 NOVARC=$(readlink -f "${BASH_SOURCE:-${0}}" 2>/dev/null) || NOVARC=$(python -c 'import os,sys; print os.path.abspath(os.path.realpath(sys.argv[1]))' "${BASH_SOURCE:-${0}}") NOVA_KEY_DIR=${NOVARC%/*} export EC2_ACCESS_KEY=f2aed2792f3a4112bcdf608e6b81ae6f export EC2_SECRET_KEY=ae3c637e7db94601b98e6729c0c2a0f7 export EC2_URL=http://$NOVA_API_HOST:8773/services/Cloud www.it-ebooks.info

