Finally, the data that is generated or used by instances must be
stored somewhere, we don't want to store it inside the instances,
because instances are volatile, they can crash, they can disappear.
For that reason, we have volumes, and we can attach them on one
instance or detach them and attach them to the other.
Let me now show you how to add storage to an instance.
Here we still have our old root disc vda, and I will now add a volume
to this instance. And we will go to the Volumes section, which we
haven't seen before. There are currently no volumes defined, let's create one.
It's very simple, I just provide a name, I will leave the rest as it is.
The size is 1 GB, as you can see. Now this volume exists,
but it doesn't belong to any instance. Let me change that.
The term here is attach, I will now attach this volume to the new webserver2 instance.
So that seems to have been successful, let's see what it looks like on
the instance itself. I run lsblk again, and indeed we now have a
second disk, also 1 GB in size, and we can just, you know, use it as a
normal disk, I'll put a file system on it, and then I'll mount it.
First I need a mount point, then the mount command, and I will put
some data on it. Great. Now let's see how we can move this data to another server.
I will unmount, and I will detach it from this instance. At this point in time,
at the Newton point in time, it's not possible to attach a volume to
more than one instance at the same time. This feature will appear in
the Queens release. So now I'm detaching the volume, it's detached,
and I will attach it immediately to the other web server instance.
Back to our webserver2, you can see now that the volume has disappeared.
Let's log onto the other web server, and I expect the volume to be
there now, and indeed it is. I will mount it, and let's check whether
the data is on there, it looks like it is indeed.
So volumes are independent from instances, the data on a volume will
persist even when any instance has disappeared.
Volumes exist without instances. And with that, we conclude this tour
of an OpenStack cloud.
So what did you just see? Let's summarize.
You know now how to access an instance on the console and over the network.
For network access, you also need ports opened in the firewall,
and it's useful to have Secure Shell keys on the instance to avoid
entering passwords when accessing them. Finally, we have a first look
at volumes and how they can be used with instances.