use backup/resore
This commit is contained in:
parent
cdf2306f04
commit
aa66087685
1 changed files with 40 additions and 11 deletions
|
|
@ -10,21 +10,46 @@ Shutdown the VM
|
||||||
gnt-instance shutdown rpki.dfw.rg.net
|
gnt-instance shutdown rpki.dfw.rg.net
|
||||||
```
|
```
|
||||||
|
|
||||||
We need to get the uuid of the volume to be reduced
|
Make sure the VM is not DRBD mirrored. If it is, then
|
||||||
|
|
||||||
```
|
|
||||||
# gnt-instance info rpki.dfw.rg.net | grep primary
|
|
||||||
- primary: vm3.dfw.rg.net
|
|
||||||
on primary: /dev/ganeti/a5ce213c-d455-4cee-a173-4c3c72d81e68.disk0_data (253:10)
|
|
||||||
on primary: /dev/ganeti/a5ce213c-d455-4cee-a173-4c3c72d81e68.disk0_meta (253:12)
|
|
||||||
```
|
|
||||||
|
|
||||||
Oops! See that disk0_meta? This means there is a drbd secondary. We never figured out how to deal with that, so you have to convert the instance to plain before proceeding.
|
|
||||||
|
|
||||||
```
|
```
|
||||||
gnt-instance modify -t plain --no-wait-for-sync rpki.dfw.rg.net
|
gnt-instance modify -t plain --no-wait-for-sync rpki.dfw.rg.net
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Shrink the partition(s)
|
||||||
|
|
||||||
|
Use a gparted bootable iso or a Linux live bootable iso to run
|
||||||
|
`gparted` to shrink the partitions.
|
||||||
|
|
||||||
|
|
||||||
|
## Backup the instance
|
||||||
|
|
||||||
|
Make sure the destination node has sufficient space. If not, on the
|
||||||
|
destination node, you can
|
||||||
|
|
||||||
|
```
|
||||||
|
lvextend -L +128G /dev/mapper/ganeti-var
|
||||||
|
resize2fs /dev/mapper/ganeti-var
|
||||||
|
```
|
||||||
|
|
||||||
|
Then
|
||||||
|
|
||||||
|
```
|
||||||
|
gnt-backup export -n vm3 rpki.dfw.rg.net
|
||||||
|
```
|
||||||
|
|
||||||
|
## Restore into Smaller Space
|
||||||
|
|
||||||
|
```
|
||||||
|
gnt-backup import -n vm0 --src-node=vm3 --disk 0:size=21G -t plain rpki.dfw.rg.net
|
||||||
|
```
|
||||||
|
|
||||||
|
## And you should be good to go
|
||||||
|
|
||||||
|
|
||||||
|
# SKIP THE REST OF THIS!!! The above is the hack you want
|
||||||
|
|
||||||
## Tell Ganeti to Chill
|
## Tell Ganeti to Chill
|
||||||
|
|
||||||
First we need to stop ganeti and backup the config file on the master
|
First we need to stop ganeti and backup the config file on the master
|
||||||
|
|
@ -80,4 +105,8 @@ gnt-instance modify -t drbd --no-wait-for-sync -n vm2 rpki.dfw.rg.net
|
||||||
gnt-instance start rpki.dfw.rg.net
|
gnt-instance start rpki.dfw.rg.net
|
||||||
```
|
```
|
||||||
|
|
||||||
And Bob's your uncle.
|
And Bob's your uncle.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
2020.10.03
|
||||||
Loading…
Add table
Add a link
Reference in a new issue