IWStack: Backups and templates

Post Reply
Admin
Site Admin
Posts: 490
Joined: Wed Jul 25, 2012 10:54 pm

IWStack: Backups and templates

Post by Admin » Fri Aug 30, 2013 9:50 am

Hello !

One very important feature of your iwStack account is the ability to take automatic backups (snapshots) and create templates for fast deployment.

1. Taking a snapshot
Taking a snapshot means duplicating the disk image as it is at a certain moment. The image is copied as it is at that particular moment when the snapshot is taken and then stored in the secondary storage. You can take an unlimited number of snapshots, however, it costs to have them stored, therefore we recommend to be reasonable and not take more than 3-4.
Let's see how it is done.
Login, go to storage (i presume you have already at least one instance in any state-running, stopped, restarting, etc) and you see something like this when you hover over the + sign near any of your drive images (can be data or root):
Image
As you see, there are clear buttons: Take snapshot and Setup recurring snapshots.
If we click the first, the snapshot is taken immediately (depending on how big your disk is, it may take a while), if we click the second we are taken to another screen where we can setup automatic back-up (snapshots):
Image
Notice that you can setup hourly, daily, weekly and monthly snapshots. I have chosen daily, at 4 AM CET and I decided to keep the last three. That is because i wish to take them at a more quiet hour in order to avoid excessive read/write on the disk during the snapshot and create load problems on the VM, you may also put some minutes after, for example 27, so you are reasonably sure not everyone is making snapshots at that moment... Click add.
What will happen is that each day at 4 AM the system will take a snapshot of the disk image and if there are already 3 in the storage, will delete the oldest after the current one was successful.
You can continue to add more automated snapshots, but they will add up in your secondary storage, so, use this with caution:
Image
That is it ! You have set up automated back-ups !
A few words of caution:
-If you have a data disk, it is recommended to save it in the same time with the root disk to avoid complications, such as data being off-sync if you have changing sets of data on both disks;
-The snapshot does not save the content of the memory, only the disk image, so, if you have a busy database, for example, which didn't flush everything to disk, you will lose the data stored in the memory. Most databases have mechanisms to protect from these situations, nevertheless, restoring such a snapshot will not resume the VM as it was at the time of the snapshot, it will be like it was rebooted forcefully. Be sure to consider this.
As a consequence, best way to do backup is with the VM shutdown, this can also be done using the API scripts (shutdown VM, do snapshot, restart VM).

2. Making a template

So, you setup your VM as you wanted it and need to replicate/store it for future use.
The best way to do this is to create a template.
A template is essentially a snapshot (can be created from snapshots too) and you can deploy it as many times as you wish, effectively cloning the VM you made into a template with different MAC addresses for network and different IP among other things. Make sure to let it use DHCP and remove all reference to MACs from the system if your OS keeps it and uses MAC as a basis for auto-naming/numbering the network interfaces. Failure to do so may cause the new VMs to be unable to access the network until you are deleting the old MACs. This is normal behaviour for some OSes and we cannot clone the MAC too, that needs to be unique or the VLAN will fail catastrophically.
Now, the practical part.
We have two ways to make a template.
-Using a snapshot if the VM needs to be on continuously;
-Using a disk of a shutdown VM (recommended).
The first method needs a snapshot first, so use the snapshot creating procedure detailed above to create one.
You will find it hovering the mouse over the + sign near the disk you created a snapshot of and click view snapshots:
Image
You can see the options, create template, restore as volume, delete.
As for the second method, it is simple, shut down your VM then go to Storage and hover the mouse over the + sign near the root disk. You will see there the create snapshot option.
Image
Please remember to shut down the VM first (if you have HA enabled, you need to shutdown from inside the IWStack interface, not from inside the VM, it will be simply rebooted as the system will believe it went down due to some accident).
If you do not shutdown the VM, you can only take a snapshot, not make a template.

rizko
Posts: 9
Joined: Sun Aug 12, 2012 11:38 pm

Re: IWStack: Backups and templates

Post by rizko » Sat Aug 31, 2013 9:29 am

Nice Article Uncle :)

Now I'm waiting article about 'How to increase Root Disk' or 'How to increase, format, attach Data Disk and attach to Instance'.

BTW I love your IWStack :)

Regards
Kurnia

zsero
Posts: 8
Joined: Mon Jan 07, 2013 5:00 pm

Re: IWStack: Backups and templates

Post by zsero » Tue May 20, 2014 1:29 am

In the making a template from a shut down VM, can you explain what does:
- password enabled
- dynamically scalable
do?

Also, which templates/ISOs are selected for 'Community' templates?

Admin
Site Admin
Posts: 490
Joined: Wed Jul 25, 2012 10:54 pm

Re: IWStack: Backups and templates

Post by Admin » Sun May 25, 2014 5:13 am

Hello!

Password enabled means that the router is giving also a password to the VM (i.e. if you deploy a template, the password will be randomly generated and displayed at first deployment, then can be changed if you wish from the interface). It needs a script inside for it to work, though. Our templates are password enabled, both linux and windows.
Dynamically scalable does not apply to KVM, which we use for our cloud, maybe we will introduce other zones later.
The community templates/ISOs are not working due tot he high risk to run one tainted by someone to steal your data.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests