diff --git a/doc/source/conf.py b/doc/source/conf.py index f933c260..403f1d1f 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -46,7 +46,7 @@ source_suffix = '.rst' master_doc = 'index' # General information about the project. -project = 'ec2-api' +project = 'EC2API Service' copyright = '2015, OpenStack Foundation' # If true, '()' will be appended to :func: etc. cross-reference text. diff --git a/doc/source/configuration/index.rst b/doc/source/configuration/index.rst index 10548834..db48149d 100644 --- a/doc/source/configuration/index.rst +++ b/doc/source/configuration/index.rst @@ -1,3 +1,5 @@ +.. _configuring: + =================== Configuring EC2-API =================== @@ -11,7 +13,7 @@ To configure your EC2API installation, you must define configuration options in A list of config options based on different topics can be found below: .. toctree:: - :maxdepth: 2 + :maxdepth: 1 api.rst metadata.rst diff --git a/doc/source/index.rst b/doc/source/index.rst index 27345ad1..17135c0f 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -3,14 +3,26 @@ OpenStack EC2 API Support of EC2 API for OpenStack. This project provides a standalone EC2 API service which pursues two goals: + 1. Implement VPC API which is now absent in nova's EC2 API + 2. Create a standalone service for EC2 API support which accommodates -not only the VPC API but the rest of the EC2 API currently present in nova as -well. + not only the VPC API but the rest of the EC2 API currently present in nova as + well. It doesn't replace existing nova EC2 API service in deployment, it gets installed to a different port (8788 by default). +The ec2-api service consists of the following components: + +``ec2-api`` service + Accepts and responds to end user EC2 and VPC API calls. + +``ec2-api-metadata`` service + Provides the OpenStack Metadata API to servers. The metadata is used to + configure the running servers. + + Installing EC2API ================= diff --git a/doc/source/install/configuration.rst b/doc/source/install/configuration.rst new file mode 100644 index 00000000..2ae95d2d --- /dev/null +++ b/doc/source/install/configuration.rst @@ -0,0 +1,60 @@ +.. _configuration: + +To configure OpenStack for EC2 API service add to ``/etc/ec2api/ec2api.conf``: + +.. code-block:: ini + + [DEFAULT] + external_network = public + ec2_port = 8788 + ec2api_listen_port = 8788 + keystone_ec2_tokens_url = http://192.168.56.101/identity/v3/ec2tokens + api_paste_config = /etc/ec2api/api-paste.ini + disable_ec2_classic = True + +.. [*] - ``external_network`` option specifies the name of the external network, + which is used to Internet and to allocate Elastic IPs. It must be + specified to get access into VMs from outside of the cloud. + + - ``disable_ec2_classic`` option is not mandatory, but we strongly + recommend it to be specified. It turns off EC2 Classic mode and forces + objects to be created inside VPCs. + + With ``disable_ec2_classic`` = True, any user of the cloud must have + the only network (created with neutron directly and attached to a router + to provide outside access for that VMS), which is used for launch + ec2-classic instances. + + Keep in mind that an operator is not able to change + ``disable_ec2_classic`` setting seamlessly. + +In the *[keystone_authtoken]* section, configure Identity service access. + +.. code-block:: ini + + [keystone_authtoken] + project_domain_name = Default + project_name = service + user_domain_name = Default + password = password + username = ec2api + auth_type = password + +Also you need to configure database connection: + +.. code-block:: ini + + [database] + connection = mysql+pymysql://root:password@127.0.0.1/ec2api?charset=utf8 + +and cache if you want to use it. + +.. code-block:: ini + + [cache] + backend = oslo_cache.dict + enabled = True + +You can look for other configuration options in the `Configuration Reference`_ + +.. _`Configuration Reference`: ../configuration/api.html \ No newline at end of file diff --git a/doc/source/install/credentials-creation.rst b/doc/source/install/credentials-creation.rst index 59001de9..9cf23e23 100644 --- a/doc/source/install/credentials-creation.rst +++ b/doc/source/install/credentials-creation.rst @@ -1,18 +1,8 @@ .. _credentials-creation: -Creating the service credentials -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The service credentials are created automatically by the install.sh. To create -them manually, complete these steps: - #. Source the ``admin`` credentials to gain access to admin-only CLI commands: - .. code-block:: console - - $ . admin-openrc - #. To create the service credentials, complete these steps: * Create the ``ec2api`` user: diff --git a/doc/source/install/database-creation.rst b/doc/source/install/database-creation.rst index 6911c481..98cb6bf9 100644 --- a/doc/source/install/database-creation.rst +++ b/doc/source/install/database-creation.rst @@ -1,12 +1,5 @@ .. _database-creation: -Creating the database -~~~~~~~~~~~~~~~~~~~~~ - -The database is created automatically by the install.sh. - -To create the database manually, complete these steps: - * Use the database access client to connect to the database server as the ``root`` user: @@ -22,7 +15,7 @@ To create the database manually, complete these steps: * Grant proper access to the ``ec2api`` database: - .. code-block:: console + .. code-block:: ini GRANT ALL PRIVILEGES ON ec2api.* TO 'ec2api'@'localhost' \ IDENTIFIED BY 'EC2-API_DBPASS'; diff --git a/doc/source/install/endpoints-creation.rst b/doc/source/install/endpoints-creation.rst index 3e2837d7..53e605b9 100644 --- a/doc/source/install/endpoints-creation.rst +++ b/doc/source/install/endpoints-creation.rst @@ -9,5 +9,5 @@ Create the ec2api service API endpoints: $ openstack endpoint create --region RegionOne ec2api \ internal http://controller:XXXX/ -- where 'controller' is address of controller, -- and 'XXXX' is port your ec2api is installed on (8788 by default) +- where 'controller' is address your ec2api is installed on +- and 'XXXX' is port (8788 by default) diff --git a/doc/source/install/get-started.rst b/doc/source/install/get-started.rst deleted file mode 100644 index e79caec0..00000000 --- a/doc/source/install/get-started.rst +++ /dev/null @@ -1,15 +0,0 @@ -========================= -EC2-API service overview -========================= - -The ec2-api service provides Amazon EC2 API support. - -The ec2-api service consists of the following components: - -``ec2-api`` service - Accepts and responds to end user EC2 and VPC API calls. - -``ec2-api-metadata`` service - Provides the OpenStack Metadata API to servers. The metadata is used to - configure the running servers. - diff --git a/doc/source/install/index.rst b/doc/source/install/index.rst index fc54c833..3118e5a1 100644 --- a/doc/source/install/index.rst +++ b/doc/source/install/index.rst @@ -2,11 +2,24 @@ Installing EC2-API ===================== -.. toctree:: - :maxdepth: 2 +This section describes how to install and configure the ec2-api service on the +controller node for Ubuntu (LTS). + +It assumes that you already have a working OpenStack environment with +at least the following components installed: Compute, Networking, Block Storage, +Identity, Image. + +.. toctree:: + :maxdepth: 1 + + install-sh.rst + install-manual.rst + install-devstack.rst + + +.. toctree:: + :maxdepth: 1 - get-started.rst - install.rst verify.rst next-steps.rst diff --git a/doc/source/install/install-devstack.rst b/doc/source/install/install-devstack.rst new file mode 100644 index 00000000..de422faf --- /dev/null +++ b/doc/source/install/install-devstack.rst @@ -0,0 +1,15 @@ +.. _install-devstack: + +Installation on DevStack +~~~~~~~~~~~~~~~~~~~~~~~~~ + +In order to install ec2-api with devstack the following should be added to the local.conf or localrc the following line: + +.. code-block:: ini + + enable_plugin ec2-api https://git.openstack.org/openstack/ec2-api + +Configuring OpenStack for EC2 API metadata service +--------------------------------------------------- + +.. include:: metadata-configuration.rst diff --git a/doc/source/install/install-manual.rst b/doc/source/install/install-manual.rst new file mode 100644 index 00000000..810ed4d2 --- /dev/null +++ b/doc/source/install/install-manual.rst @@ -0,0 +1,47 @@ +.. _install-manual: + +Manual Installation +~~~~~~~~~~~~~~~~~~~ + +Install and configure components +-------------------------------- + +1. Install the packages in any way you prefer + (**github+setup.py** / **pip** / **packages**) + +2. Create the service credentials + + .. include:: credentials-creation.rst + +3. Create database + + .. include:: database-creation.rst + + There is a script creating 'ec2api' database that is accessible + only on localhost by user 'ec2api' with password 'ec2api'. + https://github.com/openstack/ec2-api/blob/master/tools/db/ec2api-db-setup + +4. Create endpoints: + + .. include:: endpoints-creation.rst + +5. Create configuration files ``/etc/ec2api/api-paste.ini`` + (can be copied from + https://github.com/openstack/ec2-api/blob/master/etc/ec2api/api-paste.ini) + + and ``/etc/ec2api/ec2api.conf`` + + .. include:: configuration.rst + +6. Configure metadata: + + .. include:: metadata-configuration.rst + +7. Start the services as binaries + + .. code-block:: console + + $ /usr/local/bin/ec2-api + $ /usr/local/bin/ec2-api-metadata + + or set up as Linux services. diff --git a/doc/source/install/install-sh.rst b/doc/source/install/install-sh.rst new file mode 100644 index 00000000..268b6c27 --- /dev/null +++ b/doc/source/install/install-sh.rst @@ -0,0 +1,38 @@ +.. _install-sh: + +Installation by install.sh +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Install and configure components +-------------------------------- + +Install the packages: + +.. code-block:: console + + # apt-get update + # git clone https://github.com/openstack/ec2-api.git + # cd ec2-api + +Run install.sh + +The EC2 API service gets installed on port 8788 by default. It can be changed +before the installation in ``/etc/ec2api/ec2api.conf`` configuration file. + +:ref:`configuring`. + +The services afterwards can be started as binaries: + +.. code-block:: console + + $ /usr/local/bin/ec2-api + $ /usr/local/bin/ec2-api-metadata + +or set up as Linux services. + +.. include:: endpoints-creation.rst + +Configuring OpenStack for EC2 API metadata service +--------------------------------------------------- + +.. include:: metadata-configuration.rst diff --git a/doc/source/install/install-ubuntu.rst b/doc/source/install/install-ubuntu.rst index d73f830c..7e16c427 100644 --- a/doc/source/install/install-ubuntu.rst +++ b/doc/source/install/install-ubuntu.rst @@ -1,64 +1,19 @@ .. _install-ubuntu: -Installation on existing OpenStack deployment -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -This section describes how to install and configure the ec2-api -service for Ubuntu (LTS). +Install and configure +~~~~~~~~~~~~~~~~~~~~~ -Install and configure components --------------------------------- +This section describes how to install and configure the ec2-api service on the +controller node for Ubuntu (LTS). -Install the packages: +It assumes that you already have a working OpenStack environment with +at least the following components installed: Compute, Networking, Block Storage, +Identity, Image. -.. code-block:: console +.. toctree:: + :maxdepth: 1 - # apt-get update - # git clone https://github.com/openstack/ec2-api.git - # cd ec2-api - -Run install.sh - -The EC2 API service gets installed on port 8788 by default. It can be changed -before the installation in install.sh script. - -The services afterwards can be started as binaries: - -:: - - /usr/local/bin/ec2-api - /usr/local/bin/ec2-api-metadata - -or set up as Linux services. - -.. include:: endpoints-creation.rst - -Configuring OpenStack for EC2 API metadata service --------------------------------------------------- - -To configure OpenStack for EC2 API metadata service: - -for Nova-network add: - -.. code-block:: console - - # [DEFAULT] - # metadata_port = 8789 - # [neutron] - # service_metadata_proxy = True - -to ``/etc/nova.conf`` - -then restart nova-metadata (can be run as part of nova-api service) and -nova-network services. - -for Neutron add: - -.. code-block:: console - - # [DEFAULT] - # nova_metadata_port = 8789 - -to ``/etc/neutron/metadata_agent.ini`` - -then restart neutron-metadata service. + install-sh.rst + install-manual.rst + install-devstack.rst diff --git a/doc/source/install/install.rst b/doc/source/install/install.rst deleted file mode 100644 index 92bf62cf..00000000 --- a/doc/source/install/install.rst +++ /dev/null @@ -1,24 +0,0 @@ -.. _install: - -Install and configure -~~~~~~~~~~~~~~~~~~~~~ - -This section describes how to install and configure the ec2-api service on the -controller node. - -This section assumes that you already have a working OpenStack environment with -at least the following components installed: Compute, Networking, Block Storage, -Identity, Image. - -.. toctree:: - :maxdepth: 2 - - install-ubuntu.rst - -Additional steps: - -.. toctree:: - :maxdepth: 2 - - database-creation.rst - credentials-creation.rst diff --git a/doc/source/install/metadata-configuration.rst b/doc/source/install/metadata-configuration.rst new file mode 100644 index 00000000..2e0d826f --- /dev/null +++ b/doc/source/install/metadata-configuration.rst @@ -0,0 +1,14 @@ +EC2 metadata is built in between the nova-metadata and the neutron-metadata, +so we need to configure Neutron so that it sends requests to ec2-api-metadata, +not to the nova. + +To configure OpenStack for EC2 API metadata service for Neutron add: + +.. code-block:: ini + + [DEFAULT] + nova_metadata_port = 8789 + +to ``/etc/neutron/metadata_agent.ini`` + +then restart neutron-metadata service. diff --git a/doc/source/install/verify.rst b/doc/source/install/verify.rst index 53cd0205..79be1f43 100644 --- a/doc/source/install/verify.rst +++ b/doc/source/install/verify.rst @@ -14,7 +14,7 @@ Verify operation of the ec2-api service. .. code-block:: console - $ . admin-openrc + $ . openrc admin admin #. List service components to verify successful launch and registration of each process: @@ -24,8 +24,14 @@ Verify operation of the ec2-api service. $ openstack service list -#. Download aws cli from Amazon. Create configuration file for aws cli in your - home directory ``~/.aws/config``: +#. Install aws cli. + + .. code-block:: console + + # pip install awscli --upgrade --user + +#. Create configuration file for aws cli in your home directory + ``~/.aws/config`` or by "**aws configure**" command: .. code-block:: console @@ -36,7 +42,7 @@ Verify operation of the ec2-api service. Change the aws_access_key_id and aws_secret_acces_key above to the values appropriate for your cloud (can be obtained by - **"openstack ec2 credentials list"** command). + "**openstack ec2 credentials list**" command). #. Run aws cli commands using new EC2 API endpoint URL (can be obtained from keystone with the new port 8788) like this: