- Google Cloud Platform for Architects
- Vitthal Srinivasan Janani Ravi Judy Raj
- 237字
- 2021-06-25 20:48:32
How to snapshot a disk
Snapshots are used to back up persistent disks. They are different from backup disk images since they are created to be used periodically. If we create subsequent snapshots of persistent disk, only the first snapshot will back up the entire data of disk, while the other ones will only have reference to prior snapshots for the duplicate data and will contain updated data or newly added data with logs. This reduces total storage to be used and hence reduces the billing amount. To create a persistent disk snapshot, follow these steps:
- Use the gcloud compute disks snapshot command and provide a disk name as an argument:
gcloud compute disks snapshot sda
- It returns a status flag result as READY or FAILED. To verify the snapshot creation, use the following:
gcloud compute snapshots list
- To restore data from the created snapshot, create a persistent disk larger than the size of the snapshot. Do this from the snapshot itself and make sure you are not doing it from the root directory:
gcloud compute disks create sdb --source-snapshot=test-instance-snapshot --size=600GB
- Attach this persistent disk to an instance:
gcloud compute instances attach-disk test-instance01 --disk=sdb
- The preceding command is useful when snapshot and restoration disks are of the same type. For different types of disks, use a type argument and provide the disk type.
- Finally, to delete the snapshot, use the following command:
gcloud compute snapshots delete test-instance-snapshot
推薦閱讀
- GitHub Essentials
- 計(jì)算機(jī)綜合設(shè)計(jì)實(shí)驗(yàn)指導(dǎo)
- 輕松學(xué)大數(shù)據(jù)挖掘:算法、場景與數(shù)據(jù)產(chǎn)品
- 云計(jì)算與大數(shù)據(jù)應(yīng)用
- INSTANT Cytoscape Complex Network Analysis How-to
- 深度剖析Hadoop HDFS
- 中國數(shù)字流域
- ZeroMQ
- Python金融數(shù)據(jù)分析(原書第2版)
- 云數(shù)據(jù)中心網(wǎng)絡(luò)與SDN:技術(shù)架構(gòu)與實(shí)現(xiàn)
- 大數(shù)據(jù)分析:數(shù)據(jù)倉庫項(xiàng)目實(shí)戰(zhàn)
- 算力經(jīng)濟(jì):從超級計(jì)算到云計(jì)算
- 數(shù)據(jù)分析思維:產(chǎn)品經(jīng)理的成長筆記
- Unity for Architectural Visualization
- 標(biāo)簽類目體系:面向業(yè)務(wù)的數(shù)據(jù)資產(chǎn)設(shè)計(jì)方法論