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.
We will upload our newly created image as the mysql
datastore. This needs the following steps:
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
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 ''
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:
mysql
.
Manager name |
Trove class |
---|---|
Percona |
|
Redis |
|
Cassandra |
|
Couchbase |
|
MongoDB |
|
PostgreSQL |
|
Vertica |
|
DB2 |
|
MySQL |
|
true
.Once the command completes successfully, we should be able to execute the trove datastore-list
command and we should see the output.
3.129.195.112