In this lesson, I'll cover the installation of cloud-init on both Linux and AIX. Now bear with me as this video is a little longer than usual, but I wanted to keep the installation concepts in the same video given that there are common tasks to perform. You might as well see it all here in one place at one time. Let's get cloud-init installed so we can capture an image. Let's have a look at what's necessary to install cloud-init on Linux first. This graphic illustrates the high-level process for installing cloud-init onto a virtual machine before capturing. Install the dependencies, and then the cloud-init code, and then you modify the Cloud config file. I've mentioned that earlier and I'm going to provide more details on that in later videos, possibly in this video, I think. We'll see. There are a critical entries that must be made for cloud-init to function properly so that the Cloud config file update is really important. We'll also discuss operating system specific settings that have to be made in order to allow for cloud-init to do what it does. Let me start with the dependencies. As I mentioned, cloud-init has some software dependencies. Depending on the distribution and the version of Linux, different steps must be taken. For RHEL, I recommend using yum or some other package manager like DNF maybe. For RHEL 7, as of this recording, you add the epel yum repository as shown in the graphic to get the most recent level of the dependent RPMs and then you install those. Now for SLEs and Ubuntu dependencies, you see in the graphic, SLEs has specific locations where you get the dependency similar to what I just said with respect to the epel repository for yum. Then for Ubuntu, I'll be honest, way I handle this little different. I install the distribution version of cloud-init first. That's not the one I want to use, but what that does is it installs all the prerequisites. So I cheat a little bit, and then I uninstall that version and I install the PowerVC version. That may not work all the time but that has worked for me in the past. Now speaking of getting the right version of cloud-init, I just said I uninstall and reinstall the custom version. Well, it's important to understand that you need the customized version of cloud-init. But just saying why, would I need something special? Well, because IBM has made some changes that allow the deployed VM to function correctly in a PowerVM environment. Because cloud-init was originally written for Linux deploys and for KVM or deployments not to PowerVM. Here you go. Make sure you're logged in the PowerVC server, navigate to the directory that's noted in the graphic, and then down to the subdirectory for the desired operating system and you're going to find the distribution specific version of cloud-init. Red Hat's directory has packages for RHEL 6 and RHEL 7. Those are the versions that PowerVC can be installed on and SLEs has different packages for big and little endian because of the different versions of SLEs and their endianness. So you copy the correct package to the VM to be captured, manipulated there on the PowerVC server, you get it from there. So SCP it over. The next step is installing cloud-init. You would use an operating system specific command to install the package. This is just installing another package. It's not going to take long for the installation to run. Once the code is installed, it's time to configure it and there's really not much to that either. You're going to update a few fields in the cloud.config file and you're ready to go. What you see in the graphic is what you want to modify in the Cloud config file on a RHEL or on Ubuntu system. Make note of these modifications. There are key to the successful function of cloud-init in the deployment. The configDrive data source, I've mentioned this multiple times, it's extremely important. You want to set the disable root directive as shown unless you know exactly what you're doing. Why? Well, if you set that to one, you won't be able to log in to the deployed VM as root. In other words, you better have another administrative user defined in that VM that you're capturing so that you can use that in the deployment. Then finally, you enable and start the cloud-init related services by running the commands that you see in this graphic. Now this graphic describes the additional settings that must be done on a RHEL system. In summary, SELinux get set to permissive or disabled if you can get away with that, ensure that the network manager is installed and enabled and that net-tool is installed. Then finally, you turn off network management control of the interfaces by updating the NM_CONTROLLED variable to no in the ifcfg-eth*files that are in the etc sysconfig directory. You see it all on the screen there, but that's the process. Now, moving on, what you see is modification recommendations for cloud config on SLEs. Make note of these modifications. They are key to the proper functioning cloud-init in PowerVC. Again, configDrive data source is extremely important. Another key step in configuring cloud-init on Linux on Power Virtual Machine is to remove the MAC address, the media access control address, from certain configuration files. You must remove the network persistence rules in the image because they cause the network interface in the instance to come up as an interface other than eth0. This is because your image has a record of the MAC address of the network interface card when it was first installed and this MAC address is different each time the instance boots. Note that if you delete the network persistent rules files, you might get a kernel warning, you dev kernel warning at boot time. Therefore, you should clear the contents or replaced them with empty files. Now, for more details about how to remove the MAC address information, you can go to the no hard-coded MAC address information section in the OpenStack Virtual Machine Image Guide at docs.openstack.org. Now, Cloud-init handles the IP address assignment. But what about the host named RMSE and the boot list? This is really an important point here. Cloud-init handles the IP address assignment. This is the way that this newly deployed VM takes on a network identity that's different than the identity that was in the captured VM. That's really important because you don't want duplicate IP addresses. Then there's the issue of host name. There's the issue of ensuring that RMC is ready to go and also the boot list is set up right. Let's start with the host name. It can be managed after deployment if you want, manually or by using some other mechanism like say, Ansible. But Cloud-init has options actually. It has the option to set the host name to the VM name given in PowerVC, or to the resolution of the IP address, the primary IP address is assigned. Now, the DNS resolution setting is a good option, and I've used it a lot of times, but you want to keep one thing in mind. This most likely will result in the host name and the VM name being different and that might not be what you want. The RMC setting, RMC is critical to the proper management of a VM in PowerVM. We've been over that a number of times in a number of different videos. It's highly recommended. Back I'd say it's nearly mandatory that you enable reset RMC. Finally, updating boot list is a good idea so that the temporary Virtual optical device that Cloud-init config drive processing is based on is removed from the boot list. We'll close up here with this. The Cloud-init logs contain many good debug log entries from the Cloud-init processing, and they also contain some Python stacks if Cloud-init fails. Now the Cloud-init file log locations are different depending upon the distribution being used. For relevant Ubuntu, it might be necessary to edit the logging configuration found noted in the graphic and change the level from warning to debug to get log entries written to var/log/messages. Like I said earlier, I'm going to keep going. So catch your breath, it's time to switch gears now and discuss Cloud-init installation and configuration on AIX. First, it's key to say Cloud-init is fully supported on AIX, and understand its genesis was on Linux. That makes sense. It's been ported and fully supported on AIX. With the AIX 7 No.1, TLS3P5, and AX6 TL9 SP5, so older versions. There's a new device attribute or there's a device attribute on SYS 0 called Cloud Dev. Now if you're an AIX guy, you understand this stuff. If you're not, you might roll with me and maybe reference back to this later if you get into questions about Cloud Dev and go step, the role of Cloud Dev is to replace the Ghost Dev attribute, which was used in the past to reset ODM customizations when a Virtual Machine was booted on another host or with a different LPR ID. In other words, you we're cloning. When a new version of AIX that supports Cloud Dev, which is most likely going to be what you're working on. When you're using one of those, the recommendation that's set Cloud Dev to one and Ghost Dev to zero. The Cloud Dev attribute is automatically reset to zero by Cloud-init to ensure that the ODM is not reset on subsequent boots. So keep all of that in mind. Maybe reference back to that later. The Cloud-init installation on AIX, now, it's a little bit more complex than what we saw on Linux. It requires the gathering and installation of prerequisites. In this graphic, you see that to enable Python and AIX, remember, we said Cloud-init is written in Python. You need to install these prerequisites. Make note of this list, pause the screen, make note some way, do a screen capture or whatever, and then access those packages placing them in a directory that's accessible to the VM to be captured. Then you install the Python packages you see in the graphic. If you have to install those python prerequisites ahead of time or draw from them. Now there's really no good way to present this other than to just show you the packages. Have a look. Those are the things you need. Now, this graph to illustrate the high level process for installing Cloud-init onto an AIX Virtual Machine before capturing. Notice that you will have to get an install YUM. You don't have to, but that's the way to do this. Getting install YUM on AIX if you don't already have it there. You can install YUM from the AIX toolbox. This makes the installation really straightforward. Simply run YUM install Cloud-init. It's very much like Linux. The next step is to configure the Cloud config file. This graphic shows the modifications on an AIX operating system. Now these are very, very similar to what we covered in the Linux section. Back to the set host name from DNS module that allows you to get your Virtual Machines host name by using the host host name value that you've configured in your DNS server. If it's not used, the host name then defaults to the name specified in PowerVC. Like I mentioned with Linux, reset RMC, it's automatically set so that RMC is going to be handled right. That wraps up the lesson on installing Cloud config, and that was a lot to take in. So you might want to take a quick break here, and then we'll continue on with the lesson on capturing an image from a VM.