Okay, hello everyone.
My name is Titi Ma.
I'm from Redhead.
And today my topic is about snapshot, especially for the implementation in open shift virtualization,
open stack and LibWord.
Actually, I'm a QE from QMU, which is very close to LibWord.
And the main production of our LibWord is open shift virtualization and open stack.
So I made some investigation here.
And here is today's data.
So first, what is a snapshot?
A snapshot is a point in time representation or copy of data on the state of system, software,
a disk, a virtual machine or any cells.
But today I'm mainly focused on disk and virtual machine.
And actually, snapshot plays a vital role in virtualization as it is used for data backup
and recovery.
We know that data is always imported for any users.
And compared to the traditional data backup, snapshot can do a quicker backup and restore.
And about the snapshot, we can also do different snapshots in different points in time.
It means that we can restore to any historical value of our system in the state.
So here are some general user cases about the snapshot.
In our daily work, we mainly hit systems failures or data corruption.
If they have a snapshot, we can use it to do the backup and the disaster recovery.
And also it could be used for testing or developing environment.
It means that in our data testing or in our development, we may destroy our system during
our work.
If we have a snapshot, we can make use of it for this scenario too.
And also snapshots can be used for systems upgrade or software updates.
If it fails, then we can roll back to the lower value of our system.
And it can also be used for training on education scenarios.
And that students may make mistakes during their learning.
If there is a snapshot, we can also make use of it to roll back to the initial state of
the system.
And it also can be used to customer scenarios, customer issues, replication.
It means that we can save customer environment as a snapshot.
And we can use this snapshot to do the debug.
It will accelerate the problems solved here.
And a snapshot can also be used for security, incident recovery.
In today's network world, malware is everywhere.
So if our system is attacked by it, then we can make use of a snapshot for this scenario
also.
OK, from now on, I will talk about snapshots in that three platforms.
First step is about snapshot in OpenShift virtualization.
Actually, OpenShift virtualization is an add-on for OpenShift container platform.
And about the snapshot in OpenShift virtualization, OpenShift provides robust capability for it.
As it extends the base OpenShift snapshot feature to include the guest OS operation coordination
and multi-disk management.
And actually, from user space, there are two methods to create the snapshot.
Next is through the web console.
And next is created through the OS command line with YAML file.
And in the YAML file, we need to define a virtual machine snapshot as a customer resource
definition.
And the snapshot, you open a shift virtualization, we can create when the guest is powered on
or it is powered off, they are both supported.
And when the guest is powered on, we are usually recommended to install guest agent, this software
in the guest.
The guest engine here is used to free file system of the guest.
Then it gives time to flash memory data to the disk before the disk snapshot is created.
So it here to guarantee the data consistency here.
Okay, actually, the VAM snapshot in OpenShift virtualization, it makes use of a volume snapshot
for VAM snapshot.
The VAM snapshot here, yeah, VAM snapshot is a YAML file.
It actually creates corresponding volume snapshots for all the supported volumes, either VAM.
And actually, volume snapshots, the source of it usually from PBC, persistent volume claim.
We know that the real data of the PBC is stored in a PBC persistent volume.
And it could be classified into different storage classes based on different storage
bank heads.
It is the same as the same for volume snapshots.
The real data of volume snapshot is stored in volume snapshot content, this object.
And it also could be divided into different volume snapshot classes.
Yeah.
Okay, let's look at a general data flow for the snapshot in OpenShift virtualization.
You already there is a user request line to create a volume snapshot.
And the request will send it to the snapshot controller.
This controller is deployed in the control plan of OpenShift.
And here it is watching the volume snapshot, this object.
Once it detects there is the object, then it will create the corresponding volume snapshot
content here.
And there is another component named CS9 snapshot, which is a sci-dicart container in CSI driver
part.
And it is watching the volume snapshot content, this object.
Once it detects it, it will trigger the snapshot to create operations.
And actually based on different storage bank heads, the issue in command loss is different.
Like for RBD, it uses RBD snapshot related commands.
And for NFS, it uses tar command to issue the snapshot here.
And about the host pass for local file, it uses tar command also.
And for the block, it uses DD related commands for the snapshot operations.
Yeah.
Okay.
About the snapshot in OpenStack, like in OpenShift virtualization, there is also WAM
snapshot and WALM snapshot.
Actually WAM snapshot here is different from OpenShift virtualization.
Here it actually creates several images, WALM, several image snapshots.
And actually the image of the snapshot is also saved as an image file in OpenStack.
It means that you like to restore from this snapshot, you need to relunch a new instance
from the snapshot file.
And also for data consistency, guest agent is also recommended to be installed before
the snapshot is created.
And for the WALM snapshot, OpenStack is similar as the OpenShift virtualization accepts the
commands here is use OpenShift OpenStack related commands like OpenStack, WALM snapshot,
create or for the restore it use sender related commands.
Okay.
Like in low end to the data flow here.
For WALM snapshot in OpenStack, usually yes, it's the same.
There is a user request from user space.
The request will be sent to the sender component.
And first it will send to the sender API.
It will do some basic checks here.
And then it will send it to the sender scheduler.
And for the sender scheduler, it will schedule the request to different storage bankers.
It's just like the OpenShift virtualization.
And for the different storage bankers here is also the issue in commands is different.
Like for RBD, it's the same.
It use RBD related snapshot related commands here.
And for OFS, it's different.
It use the QMIL image, this QMIL tools to do the snapshot here.
And for the LVM, it use LV related commands here.
And about the VM snapshot in OpenStack, it's different.
It's also different from the OpenShift virtualization.
It does not make use of the WALM snapshot in OpenStack.
Here is such code flow.
It's mainly implemented in NOVA.
And also it can divide into live snapshot or code snapshot.
About live snapshot, the data flow first, it use the QMIL image to create a delta disk at first.
And then it use the LibWord API block rebase to rebase this delta disk to the root FI file.
And then it use the QMIL image to convert this delta to the snapshot.
After the snapshot file is created, it will delete this delta disk.
And about the code snapshot, it just use the QMIL image to convert directly to do the data transition.
Actually, when I first saw this workflow, I'm confused.
Why not use LibWord snapshot directly?
Actually, the workflow here is just some LibWord APIs or QMIL related commands.
Why not use LibWord snapshot?
Actually, the reason here is that the LibWord snapshot from the current real release note
that LibWord snapshot is not recommended to be used in that.
OK, let's look at why it is not recommended to be used.
What is the current status of the VAM snapshot in LibWord now?
The LibWord snapshot now is using internal snapshot.
So what is an internal snapshot?
Internal snapshot means that the snapshot file itself is saved in the same base image file itself.
We can image that the snapshot file and also the base file is merged in the same file.
It will be hard to maintain.
Actually, this feature is stopped developing in QMIL real level.
It is planning to be disabled in the future.
Another thing I'd like to highlight is that the VAM snapshot in LibWord is truly different from the VAM snapshot in OpelShift
virtualization and OpelStack.
In OpelShift virtualization, OpelStack is used as a guest agent to guarantee data persistence.
But in LibWord snapshot, it will include the complete systems info.
It will include the complete memory data and memory data and also the disk to see info into the snapshot file.
So it can guarantee the data persistence here.
And also for the LibWord snapshot, we can also do disk-only snapshot here.
And regarding this advantage of the internal snapshot, LibWord appears as working on external snapshot now.
And for the current status, we can create external snapshot now.
But for restore and delete, it is still under developing and there is an issue tracking it now.
And it is planning to be released in LibWord 10.
And so eventually, when this feature is supported from data persistence,
the perspective that this could be a perfect option for snapshot.
But actually, there is still some limitations for the VAM snapshot in LibWord.
As it should not source the storage bank assets that will.
And the image format of the snapshot file in LibWord must be QQ2.
While this QQ2 is not for some bank as a link from RBD bank as from the official documentation that we learned,
QQ2 is not RAM-committed over RBD as there are some performance issues there.
So, let's give a brief summary here that in high-level, we can divide the snapshot into two parts, code and live.
For code, it means that the VAM is powered off.
We can guarantee the data consistency.
But actually, more customers may prefer live snapshots as there are still some other applications.
If VAM is running in the VAM, they want to keep it running.
They want to keep it running while doing a snapshot.
So, about the live snapshot, we can also divide it into disk-only or volume-only snapshot.
There is no memory data.
It means that there is VMAH data in consistency here.
And also, another choice is VAM snapshot, the whole VAM snapshot.
There are two choices, like in OpenShift virtualization or OpenStack, they make use of guest agents, this component.
It is used to file.
But the question here is that it is just quite the file system as much as possible.
It also depends on the workloads.
It means that if there is a very heavy workload, in the VAM, there is still data loss, potential data loss here.
And another choice is the live-watch snapshot.
It will include a completely memory info in the snapshot file.
But as I also told, there are some limitations for the different storage of backhands here.
So, always based on your requirements or your environment to choose the one that suits your best.
Okay, that's all of my presentation. Thanks for listening.
Thank you.