Let's now see how we can access an instance via a console and network
in an actual cloud.
Here I'm looking at an instance that I started earlier.
As you can see, it's active, and this should enable me to see its console.
I'm first looking at the console log. And what you see here is
exactly the same thing you saw already in the GUI, and let me scroll
down to the login prompt. Here we are. I can also launch an interactive console.
The command is url show instead of lo show.
This gives me a URL, and I can just use it in a browser, copying it,
and pasting it. And here is my console. In case you want to use a
standalone client like VNC or a SPICE client, you just have to add a
parameter here, --xvpvnc gives us a URL for a standalone VNC client.
Unfortunately, Packstack has configured it so that it is a localhost
URL, so the client would have to run on the Packstack server,
and I cannot demonstrate that. In order to access the instance via
the network, let me first set up its security group.
So we have a few security groups already, the dummy one I don't need
anymore, I use it for some testing, and I'm also deleting the SSH
group, because I want to rebuild it from scratch.
Creating SSH, here we go, and I'm going to add a rule now for SSH,
and that means the destination port must be 22.
By default, the security group rule create command sets up an ingress
rule for tcp, and that's exactly what I want.
The remote_group_id and the remote_ip_prefix need to be explained perhaps.
We accept any packets from any source, as long as they go to port 22,
and the same is true for group_id, we accept packets from any security group.
Let's also create a rule for ICMP, in this case we set the protocol,
we don't worry for the destination port, there are no ports in ICMP,
there are ICMP types. So the port_range values here, they are now
interpreted as ICMP types, and this content here means that any types are accepted.
We can now list the rules. So we have four rules here, the TCP and
ICMP rules I just created, and the two others are the egress rules for
IPv4 and IPv6. And as you can see, they have a protocol of None and
no particular parameters, which means that all egress is allowed.
So my security group is set up and ready, let me add it to my instance.
And looking at the instance details, I hope we can also see the
security group now, and here it is. Notice that I indeed added SSH to
the list of security groups, now this server here has two groups,
default and ssh. Let's see whether this enables us to connect to the server.
It looks like it doesn't. There is no connectivity,
and obviously because there is no route from my current system,
which is the Packsack server, to the instance with an address of 10.
So what we need here is a floating IP. So when we need a floating IP,
perhaps we have already one that is available, so let's check.
Floating IP addresses are scarce resources, there aren't too many of
those, so you should not use them too much.
We have three of them, and none of them seems to be assigned to any
instance or any port. We only need one, and in order to limit our
bill, I'm going to delete two of them. You can see that I can delete
a floating IP using the IP address and also using its ID.
And there is one left over now, which I will add to my server.
Checking the connectivity again, that looks much better than before.
Can we see something in the server information?
The floating IP is now shown under the Networks column,
although the public network is not explicitly mentioned.
Same in the server details, now can we log on?
Oops, while the problem here is that I used this IP before for another
server, and the host key of that other server is different from the new one.
So the SSH client complains, and my solution here is to just remove
the known_hosts file. Now I can log on with a password, you have seen
me do this with the console, and now I'm doing it over the network via SSH.