Backup and restore
Quickstarts > 9. Backup and restore
In this learning module, you will learn how to secure and recover applications and data in the NHN Cloud environment. Block storage replication, instance image creation, and image-based creation to prevent data loss and build a system that enables rapid recovery.

Learning objectives
In this learning module, you'll learn to
- Create Instance Image
- Periodic backup of server-wide images using the instance image creation feature
- Creating a new instance after saving the state of a running instance as an instance image
- Replicating and attaching block storage
- Leverage block storage cloning to clone existing block storage and associate it with an instance

Before you begin
Before you begin this learning module, here's what you need to know
- Standard Internet browser
- You must have the latest version of a browser installed, such as Google Chrome, Microsoft Edge, Firefox, or Safari.
- JavaScript and cookies must be enabled in your browser settings.
- Internet connection environment
- A stable internet connection is required, with a recommended bandwidth of at least 5 Mbps.
- You must be able to communicate securely over HTTPS.
- Member account
- You must have an NHN Cloud account with a registered payment method.
- You need to log in to the NHN Cloud homepage.
This guide begins with the steps after 8. Setting up monitoring.
Creating instances and attaching block storage via instance images
Step 1. Create an instance image
Create an image of the linux-server-basic instance you created in the previous learning module. A running instance does not guarantee integrity when creating an image, so stop the instance before creating the image.
- From the top menu of the NHN Cloud console, select the organization
(MyORG), project(MyPRJ), and Korea (Pyeongchon) regionfor the lab.
- Click Compute - Instancein the left menu of the console pane.
- In the list of instances, click to select the
linux-server-basic instance.
- Click --- above the list of instances, and then click Stop instances.
- In the Stop Instance window, click Stop.
- In the Success window, click OK.
- Above the list of instances, click Create image.
- In the Create image window, set the information below and click OK.
- Image name:
linux-server-basic-image
- Delete protection:
Disabled
- Creating an image of a running instance does not guarantee its integrity. Please select the checkbox to proceed. Select the checkbox.
[Caution]
- Create a running instance image
- When you image a running instance, there are no file system integrity guarantees, and this can sometimes cause problems running the application. We recommend that you stop the instance whenever possible before creating an image.
- In the Success window, click OK.
- Click Compute - Imagein the left menu of the console window.
- On the Images screen, in the list of images, see that
the linux-server-basic-imageis being created. When creation is complete, the status indicator for that image will be green.
Step 2. Create a new instance with an instance image
Create a new linux-server-recovery instance using the linux-server-basic-image instance image you created in step 1.
- Click Compute - Instancein the left menu of the console window.
- Click Create instance.
- In the Create Instance window, set the information below and click Create Instance.
- Instance Templates
- Image
- Choose a private image image name:
linux-server-basic-image
- Instance information
- Availability zones:
Any availability zone.
- Instance name:
linux-server-recovery
- Instance Type: Select Instance Type > click Instance Type Name:
t2.c1m1 and click Select
- Number of instances:
1
- Key pair:
MyKey
- Root block storage
- Block storage type:
HDD
- Block storage size (GB):
20 GB
- Network settings: Select
Create network interface
- Network
- Under Available subnets, click the
MySubnet (192.168.0.0/24 ) resource to use it as the selected subnet.
- Floating IP: Click Change settings
- Enabled:
Enabled
- Delete protection:
Disabled
- Subnet to connect to:
MySubnet (192.168.0.0/24)
- Security groups
- Select a security group: Select
MySG-SSH, MySG-HTTP
- Additional block storage: Disabled (default)
- User scripts: Blank (default)
- Erasure protection: Disabled (default)
- In the Instance creation information pane, click Create instance.
- The instance creation operation proceeds. The instance creation will be complete in a few minutes.
Step 3. Access the instance you created
Learn how to connect via the floating IP address of the linux-server-recovery instance you created in step 2.
- Click Network - Floating IP in the left menu of the console window.
- Copy and recordthe IP address in the list of floating IP resources whose associated device
is linux-server-recovery.
- Open a new window in your web browser and type
http://복사한 linux-server-recovery floating IP addressto confirm your connection.
- Confirm that the web page opens.
- Run the command below inTerminal or PowerShellto connect remotely.
#PowerShell
cd /(name of directory where MyKey.pem file is located)
ssh -i MyKey.pem ubuntu@copy linux-server-recovery floating IP address
- When you see "Are you sure you want to continue connecting (yes/no/[fingerprint])?", type
yesand then press Enter.
- Use the lsb_release command to determine which version of Linux you are currently connected to.
#bash
lsb_release -a
Step 4. Clone an existing block storage and attach it to an instance
Clone the MyBS block storage you created in the previous learning module, connect to the linux-server-recovery instance, and query the data in the MyBS block storage.
- Click Storage - Block Storage in the left menu of the console window.
- On the Block Storage > Manage screen, select
MyBSfrom the list of block stores.
- Click Duplicate block storage.
- On the Block Storage Replication screen, set the information below and click OK.
- Target project:
Same project
- Region: Korea (Pyeongchon)
- Block storage name:
MyBS-Duplicate
- Block storage size:
10 GB(fixed)
- Block storage type:
HDD
- Availability zone: The same availability zone as the block storage whose connection information in the block storage list
is /dev/vda in linux-server-recovery.
- Block storage on a running instance does not guarantee file system integrity, please select the checkbox to proceed. Select the checkbox.
- In the Success window, click OK.
- Click the Replication Results tab to the right of the Manage Block Storage tab.
- In the replication results list, verify that the status is SUCCESS.
- Click the Manage tab.
- Select
MyBS-Duplicateand click Manage Connectionat the top.
- In the Manage Block Storage Connections window, set the information below and click Connect.
- Connect to the instance:
linux-server-recovery
- In the Success window, click OK.
- While remotely connected to the
linux-server-recovery instance, remount it to the /mnt/vdb path with the command below.
sudo mount -a
- Use the command below to check the value of the replicated block storage.
cat /mnt/vdb/employees.csv
Verify that the results from the database are retrieved as a CSV file.
References
Previous step
Next steps