# How do I build a trove image?

My Openstack cloud is quite successfully working with 3node, and now I'm stuck with Trove. I'm following http://docs.openstack.org/developer/trove/dev/building_guest_images.html (http://docs.openstack.org/developer/t...) to make an image, but quite not sure that I understand what it says. On this web page, it says commands below will make a guest image with no problem, but I don't understand how that works. HOST_USERNAME is the host where I'm making image, but where or how do I configure that? I'm having trouble starting off.... where should I start to build a trove image, or is there any other page where including detailed guide?

export HOST_USERNAME
export NETWORK_GATEWAY
export REDSTACK_SCRIPTS
export SERVICE_TYPE
export PATH_TROVE
export ESCAPED_PATH_TROVE
export SSH_DIR
export GUEST_LOGDIR
export ESCAPED_GUEST_LOGDIR
export ELEMENTS_PATH=$REDSTACK_SCRIPTS/files/elements:$PATH_TRIPLEO_ELEMENTS/elements
export DIB_CLOUD_INIT_DATASOURCES="ConfigDrive"
local QEMU_IMG_OPTIONS=$(!$(qemu-img | grep -q 'version 1') && \
echo "--qemu-img-options compat=0.10")
${PATH_DISKIMAGEBUILDER}/bin/disk-image-create -a amd64 -o "${IMAGE_NAME}" \
-x ${QEMU_IMG_OPTIONS}${DISTRO} ${EXTRA_ELEMENTS} \ vm heat-cfntools cloud-init-datasources${DISTRO}-guest \
${DISTRO}-${SERVICE_TYPE}

edit retag close merge delete

Sort by » oldest newest most voted

Hello OpenStack starter, There are actually two books you can follow, one by Amrith (from Tesora) - titled "OpenStack Trove" or another book by me, "OpenStack Trove Essentials". In my book, this is detailed in Chapter 4. I do recommend you read one of these books for a better understanding of Trove.

However for your question. You are using Disk Image Builder, so here you need a system where you would build the images. For testing purposes let it be the Trove server itself.

So, before you start to build the images, you would have done the following

1. You would have installed the Trove server components (and also the Guest agent would be copied down on the Server, while its not used from the server perspective)
2. You should have created a SSH keypair on the Trove server. This key pair will be used to copy down the Guest agent to the image. Normally, after the creation of the SSH keypair, you would have updated the Authorized Keys file under a user account.

Now assume this

The Trove Server has a hostname of "tserver", and this is where you have cloned the guest agent respository and also creating the images using the DIB. You have logged in to the "tserver", with a username of "user1".

It is under this username that you have created the SSH Keys and the authorized_keys file, by using the following commands

cd ~user1/.ssh
ssh-keygen -t rsa -b 4096
cat ~user1/.ssh/id_rsa.pub >> ~user1/.ssh/authorized_keys
chmod 755 ~user1/.ssh
chmod 644 ~user1/.ssh/authorized_keys


While, I am sure you know, ~user1 just simply points to the home directory of the user account.

You are creating the image, and you want to run the Guest agent on the trove instances (that will be cloned from your image) under the username of say "ubuntu"

Now that you have this , the config file will look like below

export HOST_USERNAME=user1
export NETWORK_GATEWAY=10.0.0.1 (Should be the IP of the Trove Server)
export REDSTACK_SCRIPTS=/opt/stack/trove-integration/scripts
export PATH_TROVE=/opt/stack/trove


Now, It allows the trove instance to connect to the trove server and fetch the guest agent upon boot. (It uses the SSH key that was generated and also the username)

more

Unfortunately, this information is out of date. trove-integration is now no longer maintained.

( 2016-11-28 10:57:12 -0500 )edit