 Okay, good afternoon. So this lightning session is about building Trove images with the disk image builder. So I'm Kyle Henderson and recently I've been working on OpenStack Ansible. And as part of that I've been working a little bit on providing Trove capabilities to OpenStack Ansible and therefore been building Trove images using the disk image builder. So we'll go through this a little bit and quickly on the agenda, but it's only a lightning talk but we'll be going through some of the disk image builder elements and we'll do a small example of the disk image builder and then talk about the Trove pieces of that and the Trove guest agent and then look at some of the reference elements that are available in the Trove integration directory. So first of all, what is the disk image builder? It's basically a tool that you can utilize to take a standard distribution input and then do some additions to it and formatting on it and then build an output to either raw or queue cow and then bring that right into a glance and then deploy it. So it's basically pretty universal but for this purpose we've been actually using it for Trove. So next chart we talk about how to install it. It just installs really easily via pip. You can create a virtual environment and install it right into a virtual environment and then if you're actually using a VM for this, it is quite disk and CPU and potensives so you wanna make sure you have enough memory and big enough disk for it itself and there's a few components that you'll need to queue EMU, image and the K-part X stuff to get the disk image builder actually running. So this image builder actually uses elements and those individual elements are kind of run down through as scripts as it's building the disk image itself so it'll take an input like a Ubuntu distro and then run down through all these different elements and actually talks about the elements at the bottom here, all the different phases of the elements. Oops, there it is. So it actually has a pretty good, this laser isn't working but it has a pretty good website about all these different elements and the stages of each one of them out in the OpenStack documentation but briefly in this presentation, I'll just look at some of the extra data one. That's actually where you pull data in from the host system into the image itself. The pre-install might be where you would set up additional repositories for packages and the install phase would be where you actually do the install of the packages for instance and then any post installation which would be like any type of configuration or maybe you wanna pull something off of the image that you don't particularly want on your image. So those are generic disk image builder elements or phases of the image build. So just for a small example here, when I was working on OpenStack Ansible, I needed to set up an image where I could use the HWE with the hardware enablement kernel. So I actually wrote a little example just to load that and it's really, really simple. It just creates a little install.d script. It has some basic setup that you can use as a pattern there from the other elements that you can use as examples. And there you can see I just do an app get. I do an install of the generic hardware enablement kernel for Xenio. So it pulls that in. And then I wrote a small little script just to make sure that I can do this over and over and over without having to type in all the extra exports and variables and things like that. So it was really, really simple just to pull in an extra package and build your own image that you can run. So with Trove, I'll do the next one. So Trove has these reference elements. It used to be in an integration, the Trove integration project prior to Ocata but was actually brought into Trove as a Ocata and you'll find it down the Trove path. For production images, you can kind of use these as examples on how to pull in all the different things that you'll need for a Trove image. But you really shouldn't use these for production images because they're basically for the CI. They do all the CI for Trove. But you can use them as examples. And that's what we did when we were pulling our Trove images. So the Trove guest image requires a Trove guest agent that actually runs on the VM and that guest agent will talk back to the different services. So you have to load that guest agent onto that image. And you have to be able to actually load that, load it and actually run it. So that's actually, that would be required but there's a bunch of optional things that you could do like preload the database packages themselves or you can actually load them at launch time. When I was building mine, I actually preferred to build them right into the image so I wouldn't spend the time of downloading all this stuff and that. But you also have to think about whether you want to enable SSH keys in a production environment or not. Should the user be able to get into the VM that Trove is running on. In my case, I was just inside doing my own little testing so I enable SSH for myself. But there's other things that you might want to consider when you're hardening that image for a production environment. So it's completely up to the user how to get that guest agent onto that image using the disk image builder. In my case, I was using OpenStack Ansible. So in OpenStack Ansible, they build a repository, a software repository. So I pulled that on the software repository, all the guest Trove agent stuff from that OpenStack Ansible and the configuration files that are built as part of the OpenStack Ansible configuration. I pulled that in to disk image builder and I was able to copy it over using the elements of the pre-build and then do the install stuff and bring it over. And I think in the CI case, they do an R-sync from the controller, which is probably not recommended in a production environment because you have direct connections between the guest VM and the controller itself. All right, so as part of the reference elements, there's a lot of variables that are exposed or used. And you can look down through some of those that are available in the documentation and a little bit on the elements themselves, but there's a lot of different variables that can be set and actually reused if you're looking to take the example, they're not real example ones, I should say, but they're the CI ones. So when we were looking down through that, we went through and found all the variables and we could tweak those a little bit and reuse some of the existing elements when we were building our elements. All right, so then actually building a Trove guest, these are all the elements that were used in the MySQL and we reuse some of them, but it kind of gives you a full list of the things that actually takes to build an image. There's a few things of doing a pre-install and doing the install piece and post-install. And part of that would be actually pulling over that Trove code into the image itself so it can be started up and then pulling in this case, there was SSH keys to do the CI, right? And then pulling all in this case, it's a trustee doing the upstart, if you had Zeno, you'd be doing the system D configuration and doing all the necessary steps to get that service up and running inside the image once it's deployed. And then finally, on the system configuration itself, there's just another Trove guest image.system.conf file that's either upstart or system D and those have some scripts inside of them that actually configures the guest agent. Once it's pulled all of the data over, it runs under a certain user and stuff like that. So there's some startup scripts that are actually in the system D in the upstart that get run before it launches the guest agent. So you wanna look at those and tweak those a bit for your environment because obviously it wouldn't be the same as the CI environment there, but it is pretty easy to follow and easy to change for a production environment. And then finally, yeah, you'd have pre, like I said, pre-start scripts and the startup scripts and then it just launches the, you wanna make sure it launches the guest agent itself. And then when you're using Trove, it would launch the VM image and then once that VM image is launched then system D or upstart would start the guest agent and then it can talk back to the rest of the Trove component tree. So that's basically all the different components that you have to build into a disk image in order to launch Trove and have the guest agent talk back to Trove. Serves this. And that's all I had for Lightning Talk. I think I had one minute left if there's any questions. Thank you.