Uploading the Trove images

Once we have created the guest images, we now need to perform the Trove operations to upload the images and register them with the Trove system for it to be usable.

We will export the credentials as we have done in the past.

cd ~
export OS_TENANT_NAME=admin
export OS_AUTH_URL=http://172.22.6.246:5000/v2.0
export OS_USERNAME=admin
export OS_PASSWORD=adm1npwd

Once this is done, we will execute the command trove datastore-list. At this point in time, it will come up as empty as we have not registered any data stores.

Uploading the Trove images

We will upload our newly created image as the mysql datastore. This needs the following steps:

  1. Upload image to Glance.
  2. Create the Trove datastore using the trove-manage command:
    glance image-create --name mysql  
    --disk-format qcow2 
    --container-format bare --visibility public 
    --file /home/alokas/images/ubuntu_mysql/ubuntu_mysql.qcow2
    
    Uploading the Trove images

We will note down the image ID, which in our case is 49412d90-2580-4e25-a463-f232a517657b.

The image is now uploaded. As the next step, we will create a data store for mysql and then subsequently add a version.

trove-manage datastore_update mysql ''
Uploading the Trove images

This creates the mysql data store. We will now update the version and other parameters.

trove-manage datastore_version_update mysql 5.6 
mysql 49412d90-2580-4e25-a463-f232a517657b 
"mysql-server-5.6" 1

Please note that we are using version 5.6, as the ubuntu-mysql element installs MySQL version 5.6. The guest agent, while booting, checks for the database version that is installed on the instance and the one requested in the data store version, and if a different version is installed, then it tries to install the right version. This feature allows us to install the database during the first boot process. This is fine when it comes to an upgrade, but in case of a downgrade, the system may not be able to handle it, so it's recommended that the data store version be the same as the version already installed in the image so as to avoid failure.

Let us take a look at the command and what it means:

  • The datastore name is mysql.
  • The version of the data store is 5.6.
  • The manager of the datastore is MySQL – Trove guest agent has manager classes for the different data stores that it supports; normally, it is the name of the database itself. Here is a list of all the manager names and their class names:

    Manager name

    Trove class

    Percona

    trove.guestagent.datastore.mysql.manager.Manager

    Redis

    trove.guestagent.datastore.experimental.redis.manager.Manager

    Cassandra

    trove.guestagent.datastore.experimental.cassandra.manager.Manager

    Couchbase

    trove.guestagent.datastore.experimental.couchbase.manager.Manager

    MongoDB

    trove.guestagent.datastore.experimental.mongodb.manager.Manager

    PostgreSQL

    trove.guestagent.datastore.experimental.postgresql.manager.Manager

    Vertica

    trove.guestagent.datastore.experimental.vertica.manager.Manager

    DB2

    trove.guestagent.datastore.experimental.db2.manager.Manager

    MySQL

    trove.guestagent.datastore.mysql.manager.Manager

  • The unique ID mentioned is the image ID from Glance (that we noted down earlier).
  • The next parameter is the user-friendly name.
  • The final one is to set the active flag to true.

Once the command completes successfully, we should be able to execute the trove datastore-list command and we should see the output.

Uploading the Trove images
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.195.112