Skip to playerSkip to main content
  • 4 days ago
Transcript
00:00Welcome to this demo on OCI compute instance. In this particular demo, we are going to instantiate
00:11an instance a compute instance in inside a VCN. And then we are going to manually build the VCN
00:20create internet gateway, modify the route tables and the security list. And then we are going to
00:26install Apache web server on this particular instance. So let's get started. All right, I'm
00:32logged on to the OCI console here in the Ashburn region. So first thing I'm going to do is I'm going
00:37to create a virtual cloud network. So click on virtual cloud network. And this time we are going
00:42to create a VCN using the manual method, not through the visit. So I click on create VCN and we need to
00:50provide a name here. So we'll say because I'm in Ashburn region. So I'll say this is IAD VCN demo
00:57sandbox compartment is fine. And here I need to select the cider blocks for the VCN. I'll use the
01:04same cider blocks we have been using until now. And right here, I can change some of these parameters,
01:11but we are okay with IPv4 and some of the default parameters here. And I'm going to click on create
01:16VCN. And this will now create a bare bones VCN. And I need to go ahead and create subnets, etc.
01:23So first thing I'm going to do is I'm going to click create subnet here. And let's create the first
01:29subnet here. And we'll call this subnet one sandbox compartment is fine. And there are two choices which
01:38we get whether it's a regional subnet or AD specific subnet will go with regional as is recommended
01:44here. And then it's asking me to provide a cider block. So we'll use the 10.0.0.0.0 slash 24. And
01:54you can see here 256 IP addresses, which are which are provided, which are available as part of this
02:00subnet. And now I can choose the subnet to be either private or public, we are going with a public
02:06subnet because we are going to spin up on a web server inside this subnet. And just all the parameters
02:11look fine. The security list here default security list is fine. And if I just scroll here, everything
02:19else the route table, I'll choose the default route table. And then I'll click on on hit create subnet.
02:25So now what we have done is we have created a VCN, we have created a subnet and associated the default
02:33route table and the default security list with the subnet. So the next thing for us to go ahead and do is
02:40create an internet gateway. And this provides the path for our packets from from the web server to
02:47to to the to the internet. So I'll give a very creative name IGW and and hit internet gateway.
02:54And now the internet gateway is created. And the subnet is created. So the next step for us is to add a
03:01route from the subnet all the way to the internet gateway. So you can see here the default route table
03:07has no rules right now. So I'll click here. And I'll add a route rule. So first it says what is my
03:14target type and my target is internet gateway. And then it says what is the destination cider block.
03:21And now I'm going to use quad zero, because this basically means all IP addresses right. And I'll choose
03:28my target as internet gateway. And I'll add this route rule. So what we've just done is we ensure we have
03:36ensured that the public subnet has a path to the internet through the internet gateway. Now the next
03:43thing for us to do is to come to the security list. And if I again, I'm using the default security list,
03:49click here, you can see the default rules which get added. And you will see that it has, you know,
03:58access for TCP at port 22, etc. So we need to add a rule to get the traffic to come on on port 80 for
04:08the web server. So again, we'll use quad zero as my source cider, meaning all IP addresses, and my
04:14destination port will become port 80. That's where the web server is running. So I'll click
04:19add ingress rule. And that's pretty much all we need to do from a VCN perspective. So we have created
04:26again, just to recap, we created a VCN, we created one public subnet, we added, we created an internet
04:33gateway. And then we change the rule in the route table to allow access out and in from through the
04:41to the internet gateway from the subnet. And then we modified the security list to allow traffic at
04:47port 80. So that's all we just did manually. If we had used wizard, some of that would have been
04:52automated. So now let's go ahead and spin up a compute instance. So I'll click here on instances,
04:59and I'll bring up the instance creation menu. So I'll click on create instance here. And it gives a
05:05name, I'm okay with that name. And right here, you can see the placement. It provides you know, 81, 82, 83.
05:13I'm okay with that. If I click on advanced options, I can see things like on demand capacity, preemptible
05:19capacity, dedicated host, etc. This is a foundational course, we're not going to get into a lot of details.
05:26But just keep in mind that there are various capacity types which are available with the compute
05:33service. And it can also choose the best fault domain. I'm just keeping giving that option to
05:39Oracle to choose the best for domain. Otherwise, I can choose for domain one, two or three here.
05:44And right here, you can see that it's picking an image and a shape. So shape is basically a template,
05:55virtual hardware template, which determines number of CPUs, amount of memory, other resources,
06:01image is basically an operating system, which runs on top of that shape. So think of this as kind of
06:06combination of hardware and software. So if I click on change image here, I can get I can see options
06:14for Windows, Linux, Red Hat, Ubuntu, etc. Right? I'm happy with Oracle Linux 8. So I'll keep that default.
06:21And if I click on change shape, now you can see that I can first choose between a virtual machine and a
06:28bare metal machine. And then bare metal basically means that you get 52 cores, it's the complete
06:34server, which is which is given to you virtual machines optional, go with that. And here you can
06:40see options for various processors, whether it's AMD, Intel, Ampere, etc. And, you know, I'll go with with
06:49AMD. And right here, you can see that these shapes have this abbreviation called flex. And basically, what that
06:56means is these are flexible shapes. So I can choose the number of CPUs and the amount of memory. So I can
07:04move these slider here, and I can actually decide, you know, what kind of, you know, or CPUs, and, you
07:11know, memory I want. So I'll go with something like one CPU and six gigafram that that sounds about right.
07:20And I'll kind of choose that shape. And right below that, I can choose my network. And this,
07:29you can see that the network we just provisioned shows up here. So that's the WCN demo network we
07:36created. And it's also picking the subnet, which is the public subnet we created. And public subnet
07:43basically means that my compute instance basically gets a public IPv4 address. So you can see that here.
07:50And below that, you have an option to add SSH keys. If you recall from the previous demo,
07:56we actually created SSH keys. And if I go to my cloud, cloud shell, and
08:02just clear the screen. And I bring up my keys, you can see that I have two, you have two keys here,
08:15it's kind of a key pair, where I have a private key and a public key. So look at the content of the
08:21public key, I can just do cat command, and I can copy this, this entire string here, because this needs
08:29to be put as part of the as as part of the server is that the problem, the private key has to go there.
08:36So I would say paste public keys, and I would paste the public key here. And there are other options
08:43which are available. But I'm just going to hit create this instance. And you will see within 1520
08:50seconds, the instance will be up and running. And we will be able to SSH into the instance,
08:56once we are able to SSH to the instance, we can we can go ahead, and we can install an Apache web
09:04server on it. So let me just hit pause here, give it a few seconds, and we'll come back once the
09:09instance is up and running. All right, so you can see here my instances up and running. And as I scroll
09:17down, I can see options like public IP address, my, you know, virtual network interface card,
09:23IP addresses, username, etc. So what I'm going to do next is I'm going to SSH into this instance. So I
09:32would say SSH minus I provide the name of my private key. So that's demo key. And right here, you can see
09:43that the instance gets a public IP address because we instantiated it in a public subnet. So I'll provide
09:51that here. But I could have just copied from here as well. So that's fine. And I'll say, you know, I want
10:00to connect to this instance, say yes. And right here, you can see now I'm inside the instance. So if I want to
10:11ping, you can see I'm connected to the instance, if I want to ping, let's see, for example, Google, because
10:17this is a public subnet, you can see that I have access to the internet. So let me go ahead and
10:26and install Apache web server on this machine. And this will take a few seconds and we'll come back
10:35and we'll see this in action. All right, so that took less than a minute. And what I did here was
10:46install Apache, and then to run some few commands, just to open up the firewalls, etc. And right here,
10:55you can see that we customize the homepage to say something like this is a web server running on OCI.
11:01So that's pretty straightforward set of commands. And right here, you can see that this is my public
11:08IP address. So let me just copy the public IP address and paste it in the browser. And you can
11:14see right here, let me zoom in, you can see that, you know, this is says this is my web server running
11:20on Oracle Cloud infrastructure. So this is how simple it is to create a compute instance in OCI. We
11:27went from from scratch, we built a network, and then we instantiated compute instance in that network.
11:35I hope you found this demo useful. Thanks for watching.
Be the first to comment
Add your comment

Recommended