[MUSIC] In this chapter where we have a collection of videos, you will learn about OCI computer related operations from an operations perspective. The specific things you're going to look at in this chapter are to manage custom images, including DR considerations. Copying images across regions and export import images from your compromise if required. What is a custom image. Before we get into custom images, let's quickly have a look at creating a compute instance. When we create a compute instance, we give various options including a name, the availability domain in which we want to provision optionally a fall domain. In which you want to provision if you want to choose that and then you go and choose the image you want. Under the images you have various categories of images that are already available. The platform images are specifically operating system. You have, open tool sento is autonomous, Lennox standard oracle Linux and windows. You can choose the version you want. When you choose a platform image, you just get an operating system with it with some default rules for the firewall. And standard configuration to only enable ssh authentication using key based authentication. There are product specific images for oracle products which are available under this. These are already published and third party providers have provided their software which can be used when we consider having a product. Either an article product or a third party partner related product. It might be available at a licensing cost or free of cost. So if you want to bring your own license, you need to procure the license from the provider and use it in the compute instance that you provision. You can create custom images which is the scope of this discussion. There are also community images which can be published and used by people in OCI. Now, when you create a compute instance, you choose various options and there is the boot volume specification that you choose. If you look at the way it works, there are various images by default available in OCI. And if I represent this as a collection of images that are available when you create a compute instance. You choose one of the images for your compute instance and a boot volume is provision based on that image that you choose. So the boot volume alone is provisioned from the image. Please remember any additional volumes you want to attach is separate, it is not part of your image that gets provisioned. And within this you can go and install any software or configure your operating system etc. Now, let's say you want to create a collection of instances which have the same configuration or same software. One option is to create each individual instance with the same image and then go and run these commands one after the other. Or perform whatever configuration you want on this instance and create a custom image out of it. A custom image is created from the boot volume of an existing instance. So considering that I already have an instance provision here. if I go to the instance page, I have the ability to create a custom image from base image. Because I've given the instance name as basically knocks image now. I have created a custom image here which will get provisions in a couple of minutes when I do that. Whatever configuration is present inside the boot volume of this instance will be exported to create a custom image. For the purpose of this demonstration I will just show you that when I created this instance I uploaded an ssh key from my Cloud shell. We see that the public is available when once this custom images created, I will provision a new compute instance from this custom image. And show you that without even uploading the public key, the public key would be available within it. Which means any data that you put into the boot volume of this instance would have been exported into the custom image. And when you create any new instances from this, they will come with the same boot volume content. So you can create custom images and you can use it in your tenancy or share it with other people if required. Fundamentally when you create an instance, you need remember the instance has a boot volume where the OS and its configuration is available. At a VC and level you may have security lives or network security group which protect at the network layer. But the firewall rules within the OS firewall are also important. For example, when you look at the oracle provided images 422 is opened by default in all the OS images that are given which are based on Linux. And if you don't want specific IP addresses to access or you want only specific IP addresses to do ssh, then you can go. And consider implementing those firewall rules inside the compute instance, then always keep your OS updated with the latest patches. We will look at how do we do that in an automated manner in a later video when we look at OS management. So these are some of the important things one has to consider when setting up an instance. Once you have the best practices implemented in an instance, you may go and create a custom image and once the custom images available. You can create multiple instances from that all of them will have the same settings as the boot volume of the base instance that was available. And please remember custom images take care of only the boot volume. If you want to attach additional block volumes to your instances, you could use the cloning feature or backup feature of block volumes to create new block volumes. And attach them to the newly created instances. Now let's go back to our instance, the instances running the base instances back to normal. But if I go into the custom images section, I will see that a base images created. A custom image with this name is created from here itself. I can create an instance and we see here it is based out of this oracle provided image that the base instance was created. Or instead of using the menu here I could also go to create an instance and over here I will say with custom image as the name of the instance. I will choose a particular ready and under images, I am now going to choose custom images. Custom images are region specific. You could use it in any area within the given region. I will choose the standard shape that is available provision in the same BCN and sub net assign it a public IP. I will hear choose no ssh keys. This is the catch because when I created the custom image, the base instance from which I created already had an ssh publicly uploaded. And that's what I'm going to show you. Let me create this instance, when the instance gets provisioned please remember. It would have used the custom image with whatever details that were available inside the boot volume of the original instance. In this case the ssh key was there? If you had any software installed or any other settings you have done in the OS configuration. All of them would have been intact in the custom image. And when you create new instances using that custom image, all that data in the boot volume is brought into the new instances boot volume. Now that my instance is running and it has got a public IP. Let me show you that I will be able to ssh into the OPC user of this new compute instance. And the way the authentication happens is using the ssh private key which is available in the same directory. So this is going to prompt me. Are you sure you want to connect to this new IP address? Yes, now I have logged in to the computer instance called with custom image. And if I go to the ssh directory and look up there is a file authorized keys and if I look into the contents it is the same publicly that I have in my cloud shell environment also. It's the same key that got uploaded and when I provisioned this instance I did not specify any public key to be uploaded from the custom image. The same ssh key came in. Any other configuration would have also come in similar to that. Now, another important thing you need remembers. Custom images are region specific. If I go to another region and if I go to the custom images section, I wouldn't see the custom image that I created in Frankfurt. There is a way to export and import custom images which we will see in another video. That's a quick look at custom images as usher. Another option you can consider here is when you create a custom image, you have the ability to have your custom scripts in them. Like what I told you earlier, when you create the first instance, you might have a particular in its script specified at the time of creating the instance. And this could be certain tasks you want to run when the instance is created. How do you add this custom script to be executed during an instance creation? When we go to the instance creation page, we have the ability to go to the advanced options. And in this over here you can give the cloud in its script so that whenever you provision an instance, you want certain tasks to be done. You can type out the cloud in it's commands or have a script which you want to upload and keep in mind depending on which OS you are using. If it is windows, you have a cloud base in it which you can use for Linux, Standard Cloud Linux which it supports. Could be used so that automatically certain things could be executed once the instance is provisioned. That's about using custom images and the cloud in it to simplify your operations of creating multiple. Compute instances with a similar setup of software and configuration in the operating system