virt-back 0.2.1__tar.gz → 0.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- virt-back-0.2.3/PKG-INFO +173 -0
- {virt-back-0.2.1 → virt-back-0.2.3}/README.md +33 -1
- virt-back-0.2.3/setup.py +47 -0
- virt-back-0.2.3/virt_back.egg-info/PKG-INFO +173 -0
- {virt-back-0.2.1 → virt-back-0.2.3}/virt_back.egg-info/SOURCES.txt +1 -0
- virt-back-0.2.3/virt_back.egg-info/requires.txt +1 -0
- virt-back-0.2.1/PKG-INFO +0 -18
- virt-back-0.2.1/setup.py +0 -45
- virt-back-0.2.1/virt_back.egg-info/PKG-INFO +0 -18
- {virt-back-0.2.1 → virt-back-0.2.3}/setup.cfg +0 -0
- {virt-back-0.2.1 → virt-back-0.2.3}/virt-back +0 -0
- {virt-back-0.2.1 → virt-back-0.2.3}/virt_back.egg-info/dependency_links.txt +0 -0
- {virt-back-0.2.1 → virt-back-0.2.3}/virt_back.egg-info/top_level.txt +0 -0
- {virt-back-0.2.1 → virt-back-0.2.3}/virtback.py +0 -0
virt-back-0.2.3/PKG-INFO
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: virt-back
|
|
3
|
+
Version: 0.2.3
|
|
4
|
+
Summary: virt-back: A backup utility for QEMU, KVM, XEN, and Virtualbox guests
|
|
5
|
+
Home-page: https://git.unturf.com/python/virt-back
|
|
6
|
+
Author: Russell Ballestrini
|
|
7
|
+
Author-email: russell@ballestrini.net
|
|
8
|
+
License: Public Domain
|
|
9
|
+
Keywords: backup virtual hypervisor QEMU KVM XEN Virtualbox
|
|
10
|
+
Platform: All
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
|
|
13
|
+
A backup utility for QEMU, KVM, XEN, and Virtualbox guests.
|
|
14
|
+
|
|
15
|
+
Virt-back is a python application that uses the libvirt api to safely
|
|
16
|
+
shutdown, gzip, and restart guests. The backup process logs to syslog
|
|
17
|
+
for auditing and virt-back works great with cron for scheduling outages.
|
|
18
|
+
Virt-back has been placed in the public domain and
|
|
19
|
+
the latest version may be downloaded here:
|
|
20
|
+
|
|
21
|
+
https://git.unturf.com/python/virt-back
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
**usage**
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
root@guile[/mnt/downloads/virt-back]# ./virt-back --help
|
|
28
|
+
Usage: virt-back [options]
|
|
29
|
+
|
|
30
|
+
A backup utility for QEMU, KVM, XEN, and Virtualbox guests. Virt-back is a
|
|
31
|
+
python application that uses the libvirt api to safely shutdown, gzip, and
|
|
32
|
+
restart guests. The backup process logs to syslog for auditing and virt-back
|
|
33
|
+
works great with cron for scheduling outages. Virt-back has been placed in the
|
|
34
|
+
public domain and the latest version may be downloaded here:
|
|
35
|
+
https://git.unturf.com/python/virt-back
|
|
36
|
+
|
|
37
|
+
Options:
|
|
38
|
+
-h, --help show this help message and exit
|
|
39
|
+
-q, --quiet prevent output to stdout
|
|
40
|
+
-d, --date append date to tar filename [default: no date]
|
|
41
|
+
-g, --no-gzip do not gzip the resulting tar file
|
|
42
|
+
-a amount, --retention=amount
|
|
43
|
+
backups to retain [default: 3]
|
|
44
|
+
-p 'PATH', --path='PATH'
|
|
45
|
+
backup path [default: '/KVMBACK']
|
|
46
|
+
-u 'URI', --uri='URI'
|
|
47
|
+
optional hypervisor uri
|
|
48
|
+
|
|
49
|
+
Actions for info testing:
|
|
50
|
+
These options display info or test a list of guests.
|
|
51
|
+
|
|
52
|
+
-i, --info info/test a list of guests (space delimited dom names)
|
|
53
|
+
--info-all attempt to show info on ALL guests
|
|
54
|
+
|
|
55
|
+
Actions for a list of dom names:
|
|
56
|
+
WARNING: These options WILL bring down guests!
|
|
57
|
+
|
|
58
|
+
-b, --backup backup a list of guests (space delimited dom names)
|
|
59
|
+
-r, --reboot reboot a list of guests (space delimited dom names)
|
|
60
|
+
-s, --shutdown shutdown a list of guests (space delimited dom names)
|
|
61
|
+
-c, --create start a list of guests (space delimited dom names)
|
|
62
|
+
|
|
63
|
+
Actions for all doms:
|
|
64
|
+
WARNING: These options WILL bring down ALL guests!
|
|
65
|
+
|
|
66
|
+
--backup-all attempt to shutdown, backup, and start ALL guests
|
|
67
|
+
--reboot-all attempt to shutdown and then start ALL guests
|
|
68
|
+
--shutdown-all attempt to shutdown ALL guests
|
|
69
|
+
--create-all attempt to start ALL guests
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
## Dependencies
|
|
74
|
+
|
|
75
|
+
Before installing `virt-back`, you need to ensure that the necessary development libraries for `libvirt` are installed on your system. These libraries are required for the `libvirt-python` package, which `virt-back` depends on.
|
|
76
|
+
|
|
77
|
+
### Fedora/RedHat
|
|
78
|
+
|
|
79
|
+
On Fedora or RedHat-based systems, you can install the `libvirt-devel` package using `dnf`:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
sudo dnf install libvirt-devel
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Ubuntu/Debian
|
|
86
|
+
|
|
87
|
+
On Ubuntu or Debian-based systems, you can install the `libvirt-dev` package using `apt-get`:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
sudo apt-get install libvirt-dev
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Installing `virt-back`
|
|
94
|
+
|
|
95
|
+
Once the necessary development libraries are installed, you can install `virt-back` using `pip`:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
pip install virt-back
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
This will install `virt-back` along with its dependencies, including `libvirt-python`.
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
## How to backup zfs snapshot all KVM instances on a TrueNAS Scale,
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
root@guile[/mnt/downloads/virt-back]# ./virt-back -u "qemu+unix:///system?socket=/run/truenas_libvirt/libvirt-sock" --backup-all --path /mnt/personal/backup/virt-back --no-gzip --retention 5
|
|
108
|
+
|
|
109
|
+
shutdown: invoking shutdown on 1_akuma
|
|
110
|
+
shutdown: waited 0 seconds for 1_akuma to shut off
|
|
111
|
+
backup: invoking backup for 1_akuma
|
|
112
|
+
backup: checking if /dev/zvol/downloads/akuma-tfjpo7 is a ZFS dataset
|
|
113
|
+
backup: downloads/akuma-tfjpo7 is a ZFS dataset
|
|
114
|
+
backup: creating ZFS snapshot downloads/akuma-tfjpo7@backup-2024-07-07-2 for 1_akuma
|
|
115
|
+
backup: sending ZFS snapshot downloads/akuma-tfjpo7@backup-2024-07-07-2 to /mnt/personal/backup/virt-back/1_akuma-2024-07-07.zfs for 1_akuma
|
|
116
|
+
backup: skipping ISO file /mnt/downloads/iso/ubuntu-24.04-live-server-amd64.iso for 1_akuma
|
|
117
|
+
create: invoking create on 1_akuma
|
|
118
|
+
backup: rotating backup files for 1_akuma
|
|
119
|
+
backup: archiving files for 1_akuma to /mnt/personal/backup/virt-back/1_akuma.tar
|
|
120
|
+
backup: archiving /mnt/personal/backup/virt-back/1_akuma.xml for 1_akuma
|
|
121
|
+
backup: checking if /dev/zvol/downloads/akuma-tfjpo7 is a ZFS dataset
|
|
122
|
+
backup: downloads/akuma-tfjpo7 is a ZFS dataset
|
|
123
|
+
backup: archiving /mnt/personal/backup/virt-back/1_akuma-2024-07-07.zfs for 1_akuma
|
|
124
|
+
backup: finished backup for 1_akuma
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Restoring from a ZFS Backup
|
|
128
|
+
|
|
129
|
+
This section explains how to restore a KVM instance from a ZFS backup using the `virt-back` utility. The process involves extracting the backup archive, restoring the ZFS snapshot, and creating a new VM in TrueNAS Scale using the restored ZFS volume.
|
|
130
|
+
|
|
131
|
+
### Step-by-Step Restore Process
|
|
132
|
+
|
|
133
|
+
1. **Extract the Backup Archive**: Extract the tar archive to get the ZFS snapshot file and the XML configuration file.
|
|
134
|
+
2. **Restore the ZFS Snapshot to a New Dataset**: Use the `zfs receive` command to restore the ZFS snapshot to a new dataset.
|
|
135
|
+
3. **Create a New VM in TrueNAS Scale**: Use the TrueNAS Scale UI to create a new VM and point it to the restored ZFS volume.
|
|
136
|
+
|
|
137
|
+
### Detailed Steps
|
|
138
|
+
|
|
139
|
+
#### 1. Extract the Backup Archive
|
|
140
|
+
|
|
141
|
+
First, extract the tar archive to get the ZFS snapshot file and the XML configuration file. Use the `--strip-components` option to remove the leading directory components if necessary.
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
tar -xvf /mnt/personal/backup/virt-back/1_akuma.tar --strip-components=4 -C /mnt/personal/backup/virt-back
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
This command will extract the files directly to the `/mnt/personal/backup/virt-back` directory, removing the leading directory components.
|
|
148
|
+
|
|
149
|
+
#### 2. Restore the ZFS Snapshot to a New Dataset
|
|
150
|
+
|
|
151
|
+
Use the `zfs receive` command to restore the ZFS snapshot to a new dataset. Assuming the extracted ZFS snapshot file is named `1_akuma-2024-07-07.zfs`:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
zfs receive -F downloads/akuma-tfjpo7-restored < /mnt/personal/backup/virt-back/1_akuma-2024-07-07.zfs
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
This command will restore the ZFS snapshot to the `downloads/akuma-tfjpo7-restored` dataset.
|
|
158
|
+
|
|
159
|
+
#### 3. Create a New VM in TrueNAS Scale
|
|
160
|
+
|
|
161
|
+
1. **Open TrueNAS Scale UI**: Log in to the TrueNAS Scale web interface.
|
|
162
|
+
2. **Navigate to Virtual Machines**: Go to the "Virtual Machines" section.
|
|
163
|
+
3. **Create a New VM**:
|
|
164
|
+
- Click on "Add" to create a new VM.
|
|
165
|
+
- Fill in the necessary details for the new VM (e.g., name, CPU, memory).
|
|
166
|
+
4. **Attach the Restored ZFS Volume**:
|
|
167
|
+
- In the "Disks" section, add a new disk.
|
|
168
|
+
- Select "Existing Zvol" and choose the restored ZFS volume (`downloads/akuma-tfjpo7-restored`).
|
|
169
|
+
5. **Complete the VM Creation**: Finish the VM creation process by following the remaining steps in the UI.
|
|
170
|
+
|
|
171
|
+
### Summary
|
|
172
|
+
|
|
173
|
+
By following these steps, you can restore the ZFS snapshot and reattach it to a new VM using the TrueNAS Scale UI. This process involves extracting the backup archive, restoring the ZFS snapshot to a new dataset, and creating a new VM in TrueNAS Scale, pointing it to the restored ZFS volume. This approach ensures that the original dataset remains unaffected and allows you to easily restore and reattach your KVM instances. It's similar to cloning an existing instance except it's from a file backup so the machine will have all the attributes of the clone don't start them both at the same time because that would have IP address overlaps etc.
|
|
@@ -57,7 +57,39 @@ Options:
|
|
|
57
57
|
--create-all attempt to start ALL guests
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
|
|
61
|
+
## Dependencies
|
|
62
|
+
|
|
63
|
+
Before installing `virt-back`, you need to ensure that the necessary development libraries for `libvirt` are installed on your system. These libraries are required for the `libvirt-python` package, which `virt-back` depends on.
|
|
64
|
+
|
|
65
|
+
### Fedora/RedHat
|
|
66
|
+
|
|
67
|
+
On Fedora or RedHat-based systems, you can install the `libvirt-devel` package using `dnf`:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
sudo dnf install libvirt-devel
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Ubuntu/Debian
|
|
74
|
+
|
|
75
|
+
On Ubuntu or Debian-based systems, you can install the `libvirt-dev` package using `apt-get`:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
sudo apt-get install libvirt-dev
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Installing `virt-back`
|
|
82
|
+
|
|
83
|
+
Once the necessary development libraries are installed, you can install `virt-back` using `pip`:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
pip install virt-back
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
This will install `virt-back` along with its dependencies, including `libvirt-python`.
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
## How to backup zfs snapshot all KVM instances on a TrueNAS Scale,
|
|
61
93
|
|
|
62
94
|
```
|
|
63
95
|
root@guile[/mnt/downloads/virt-back]# ./virt-back -u "qemu+unix:///system?socket=/run/truenas_libvirt/libvirt-sock" --backup-all --path /mnt/personal/backup/virt-back --no-gzip --retention 5
|
virt-back-0.2.3/setup.py
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
from setuptools import setup
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
# Read the contents of your README file
|
|
5
|
+
with open(os.path.join(os.path.dirname(__file__), "README.md"), encoding="utf-8") as f:
|
|
6
|
+
long_description = f.read()
|
|
7
|
+
|
|
8
|
+
setup(
|
|
9
|
+
name="virt-back",
|
|
10
|
+
version="0.2.3",
|
|
11
|
+
description="virt-back: A backup utility for QEMU, KVM, XEN, and Virtualbox guests",
|
|
12
|
+
keywords="backup virtual hypervisor QEMU KVM XEN Virtualbox",
|
|
13
|
+
long_description=long_description,
|
|
14
|
+
long_description_content_type="text/markdown",
|
|
15
|
+
author="Russell Ballestrini",
|
|
16
|
+
author_email="russell@ballestrini.net",
|
|
17
|
+
url="https://git.unturf.com/python/virt-back",
|
|
18
|
+
platforms=["All"],
|
|
19
|
+
license="Public Domain",
|
|
20
|
+
py_modules=["virtback"],
|
|
21
|
+
include_package_data=True,
|
|
22
|
+
scripts=["virt-back"],
|
|
23
|
+
install_requires=[
|
|
24
|
+
"libvirt-python",
|
|
25
|
+
],
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
"""
|
|
29
|
+
setup()
|
|
30
|
+
keyword args: http://peak.telecommunity.com/DevCenter/setuptools
|
|
31
|
+
|
|
32
|
+
# built and uploaded to pypi with this:
|
|
33
|
+
|
|
34
|
+
python setup.py sdist
|
|
35
|
+
twine upload dist/*
|
|
36
|
+
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
# Installation Instructions:
|
|
40
|
+
# To install virt-back, you can use pip:
|
|
41
|
+
# * pip install virt-back
|
|
42
|
+
#
|
|
43
|
+
# Note: You need to have the libvirt development libraries installed.
|
|
44
|
+
# On Fedora/RedHat, you can install it with:
|
|
45
|
+
# * sudo dnf install libvirt-devel
|
|
46
|
+
# On Ubuntu, you can install it with:
|
|
47
|
+
# * sudo apt-get install libvirt-dev
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: virt-back
|
|
3
|
+
Version: 0.2.3
|
|
4
|
+
Summary: virt-back: A backup utility for QEMU, KVM, XEN, and Virtualbox guests
|
|
5
|
+
Home-page: https://git.unturf.com/python/virt-back
|
|
6
|
+
Author: Russell Ballestrini
|
|
7
|
+
Author-email: russell@ballestrini.net
|
|
8
|
+
License: Public Domain
|
|
9
|
+
Keywords: backup virtual hypervisor QEMU KVM XEN Virtualbox
|
|
10
|
+
Platform: All
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
|
|
13
|
+
A backup utility for QEMU, KVM, XEN, and Virtualbox guests.
|
|
14
|
+
|
|
15
|
+
Virt-back is a python application that uses the libvirt api to safely
|
|
16
|
+
shutdown, gzip, and restart guests. The backup process logs to syslog
|
|
17
|
+
for auditing and virt-back works great with cron for scheduling outages.
|
|
18
|
+
Virt-back has been placed in the public domain and
|
|
19
|
+
the latest version may be downloaded here:
|
|
20
|
+
|
|
21
|
+
https://git.unturf.com/python/virt-back
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
**usage**
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
root@guile[/mnt/downloads/virt-back]# ./virt-back --help
|
|
28
|
+
Usage: virt-back [options]
|
|
29
|
+
|
|
30
|
+
A backup utility for QEMU, KVM, XEN, and Virtualbox guests. Virt-back is a
|
|
31
|
+
python application that uses the libvirt api to safely shutdown, gzip, and
|
|
32
|
+
restart guests. The backup process logs to syslog for auditing and virt-back
|
|
33
|
+
works great with cron for scheduling outages. Virt-back has been placed in the
|
|
34
|
+
public domain and the latest version may be downloaded here:
|
|
35
|
+
https://git.unturf.com/python/virt-back
|
|
36
|
+
|
|
37
|
+
Options:
|
|
38
|
+
-h, --help show this help message and exit
|
|
39
|
+
-q, --quiet prevent output to stdout
|
|
40
|
+
-d, --date append date to tar filename [default: no date]
|
|
41
|
+
-g, --no-gzip do not gzip the resulting tar file
|
|
42
|
+
-a amount, --retention=amount
|
|
43
|
+
backups to retain [default: 3]
|
|
44
|
+
-p 'PATH', --path='PATH'
|
|
45
|
+
backup path [default: '/KVMBACK']
|
|
46
|
+
-u 'URI', --uri='URI'
|
|
47
|
+
optional hypervisor uri
|
|
48
|
+
|
|
49
|
+
Actions for info testing:
|
|
50
|
+
These options display info or test a list of guests.
|
|
51
|
+
|
|
52
|
+
-i, --info info/test a list of guests (space delimited dom names)
|
|
53
|
+
--info-all attempt to show info on ALL guests
|
|
54
|
+
|
|
55
|
+
Actions for a list of dom names:
|
|
56
|
+
WARNING: These options WILL bring down guests!
|
|
57
|
+
|
|
58
|
+
-b, --backup backup a list of guests (space delimited dom names)
|
|
59
|
+
-r, --reboot reboot a list of guests (space delimited dom names)
|
|
60
|
+
-s, --shutdown shutdown a list of guests (space delimited dom names)
|
|
61
|
+
-c, --create start a list of guests (space delimited dom names)
|
|
62
|
+
|
|
63
|
+
Actions for all doms:
|
|
64
|
+
WARNING: These options WILL bring down ALL guests!
|
|
65
|
+
|
|
66
|
+
--backup-all attempt to shutdown, backup, and start ALL guests
|
|
67
|
+
--reboot-all attempt to shutdown and then start ALL guests
|
|
68
|
+
--shutdown-all attempt to shutdown ALL guests
|
|
69
|
+
--create-all attempt to start ALL guests
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
## Dependencies
|
|
74
|
+
|
|
75
|
+
Before installing `virt-back`, you need to ensure that the necessary development libraries for `libvirt` are installed on your system. These libraries are required for the `libvirt-python` package, which `virt-back` depends on.
|
|
76
|
+
|
|
77
|
+
### Fedora/RedHat
|
|
78
|
+
|
|
79
|
+
On Fedora or RedHat-based systems, you can install the `libvirt-devel` package using `dnf`:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
sudo dnf install libvirt-devel
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Ubuntu/Debian
|
|
86
|
+
|
|
87
|
+
On Ubuntu or Debian-based systems, you can install the `libvirt-dev` package using `apt-get`:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
sudo apt-get install libvirt-dev
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Installing `virt-back`
|
|
94
|
+
|
|
95
|
+
Once the necessary development libraries are installed, you can install `virt-back` using `pip`:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
pip install virt-back
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
This will install `virt-back` along with its dependencies, including `libvirt-python`.
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
## How to backup zfs snapshot all KVM instances on a TrueNAS Scale,
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
root@guile[/mnt/downloads/virt-back]# ./virt-back -u "qemu+unix:///system?socket=/run/truenas_libvirt/libvirt-sock" --backup-all --path /mnt/personal/backup/virt-back --no-gzip --retention 5
|
|
108
|
+
|
|
109
|
+
shutdown: invoking shutdown on 1_akuma
|
|
110
|
+
shutdown: waited 0 seconds for 1_akuma to shut off
|
|
111
|
+
backup: invoking backup for 1_akuma
|
|
112
|
+
backup: checking if /dev/zvol/downloads/akuma-tfjpo7 is a ZFS dataset
|
|
113
|
+
backup: downloads/akuma-tfjpo7 is a ZFS dataset
|
|
114
|
+
backup: creating ZFS snapshot downloads/akuma-tfjpo7@backup-2024-07-07-2 for 1_akuma
|
|
115
|
+
backup: sending ZFS snapshot downloads/akuma-tfjpo7@backup-2024-07-07-2 to /mnt/personal/backup/virt-back/1_akuma-2024-07-07.zfs for 1_akuma
|
|
116
|
+
backup: skipping ISO file /mnt/downloads/iso/ubuntu-24.04-live-server-amd64.iso for 1_akuma
|
|
117
|
+
create: invoking create on 1_akuma
|
|
118
|
+
backup: rotating backup files for 1_akuma
|
|
119
|
+
backup: archiving files for 1_akuma to /mnt/personal/backup/virt-back/1_akuma.tar
|
|
120
|
+
backup: archiving /mnt/personal/backup/virt-back/1_akuma.xml for 1_akuma
|
|
121
|
+
backup: checking if /dev/zvol/downloads/akuma-tfjpo7 is a ZFS dataset
|
|
122
|
+
backup: downloads/akuma-tfjpo7 is a ZFS dataset
|
|
123
|
+
backup: archiving /mnt/personal/backup/virt-back/1_akuma-2024-07-07.zfs for 1_akuma
|
|
124
|
+
backup: finished backup for 1_akuma
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Restoring from a ZFS Backup
|
|
128
|
+
|
|
129
|
+
This section explains how to restore a KVM instance from a ZFS backup using the `virt-back` utility. The process involves extracting the backup archive, restoring the ZFS snapshot, and creating a new VM in TrueNAS Scale using the restored ZFS volume.
|
|
130
|
+
|
|
131
|
+
### Step-by-Step Restore Process
|
|
132
|
+
|
|
133
|
+
1. **Extract the Backup Archive**: Extract the tar archive to get the ZFS snapshot file and the XML configuration file.
|
|
134
|
+
2. **Restore the ZFS Snapshot to a New Dataset**: Use the `zfs receive` command to restore the ZFS snapshot to a new dataset.
|
|
135
|
+
3. **Create a New VM in TrueNAS Scale**: Use the TrueNAS Scale UI to create a new VM and point it to the restored ZFS volume.
|
|
136
|
+
|
|
137
|
+
### Detailed Steps
|
|
138
|
+
|
|
139
|
+
#### 1. Extract the Backup Archive
|
|
140
|
+
|
|
141
|
+
First, extract the tar archive to get the ZFS snapshot file and the XML configuration file. Use the `--strip-components` option to remove the leading directory components if necessary.
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
tar -xvf /mnt/personal/backup/virt-back/1_akuma.tar --strip-components=4 -C /mnt/personal/backup/virt-back
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
This command will extract the files directly to the `/mnt/personal/backup/virt-back` directory, removing the leading directory components.
|
|
148
|
+
|
|
149
|
+
#### 2. Restore the ZFS Snapshot to a New Dataset
|
|
150
|
+
|
|
151
|
+
Use the `zfs receive` command to restore the ZFS snapshot to a new dataset. Assuming the extracted ZFS snapshot file is named `1_akuma-2024-07-07.zfs`:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
zfs receive -F downloads/akuma-tfjpo7-restored < /mnt/personal/backup/virt-back/1_akuma-2024-07-07.zfs
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
This command will restore the ZFS snapshot to the `downloads/akuma-tfjpo7-restored` dataset.
|
|
158
|
+
|
|
159
|
+
#### 3. Create a New VM in TrueNAS Scale
|
|
160
|
+
|
|
161
|
+
1. **Open TrueNAS Scale UI**: Log in to the TrueNAS Scale web interface.
|
|
162
|
+
2. **Navigate to Virtual Machines**: Go to the "Virtual Machines" section.
|
|
163
|
+
3. **Create a New VM**:
|
|
164
|
+
- Click on "Add" to create a new VM.
|
|
165
|
+
- Fill in the necessary details for the new VM (e.g., name, CPU, memory).
|
|
166
|
+
4. **Attach the Restored ZFS Volume**:
|
|
167
|
+
- In the "Disks" section, add a new disk.
|
|
168
|
+
- Select "Existing Zvol" and choose the restored ZFS volume (`downloads/akuma-tfjpo7-restored`).
|
|
169
|
+
5. **Complete the VM Creation**: Finish the VM creation process by following the remaining steps in the UI.
|
|
170
|
+
|
|
171
|
+
### Summary
|
|
172
|
+
|
|
173
|
+
By following these steps, you can restore the ZFS snapshot and reattach it to a new VM using the TrueNAS Scale UI. This process involves extracting the backup archive, restoring the ZFS snapshot to a new dataset, and creating a new VM in TrueNAS Scale, pointing it to the restored ZFS volume. This approach ensures that the original dataset remains unaffected and allows you to easily restore and reattach your KVM instances. It's similar to cloning an existing instance except it's from a file backup so the machine will have all the attributes of the clone don't start them both at the same time because that would have IP address overlaps etc.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
libvirt-python
|
virt-back-0.2.1/PKG-INFO
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: virt-back
|
|
3
|
-
Version: 0.2.1
|
|
4
|
-
Summary: virt-back: A backup utility for QEMU, KVM, XEN, and Virtualbox guests
|
|
5
|
-
Home-page: https://git.unturf.com/python/virt-back
|
|
6
|
-
Author: Russell Ballestrini
|
|
7
|
-
Author-email: russell@ballestrini.net
|
|
8
|
-
License: Public Domain
|
|
9
|
-
Keywords: backup virtual hypervisor QEMU KVM XEN Virtualbox
|
|
10
|
-
Platform: All
|
|
11
|
-
|
|
12
|
-
A backup utility for QEMU, KVM, XEN, and Virtualbox guests.
|
|
13
|
-
Virt-back is a python application that uses the libvirt api to safely
|
|
14
|
-
shutdown, gzip, and restart guests. The backup process logs to syslog
|
|
15
|
-
for auditing and virt-back works great with cron for scheduling outages.
|
|
16
|
-
Virt-back has been placed in the public domain and
|
|
17
|
-
the latest version may be downloaded here:
|
|
18
|
-
https://git.unturf.com/python/virt-back
|
virt-back-0.2.1/setup.py
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
# installation:
|
|
2
|
-
# * pip install virt-back
|
|
3
|
-
# * easy_install virt-back
|
|
4
|
-
from setuptools import setup
|
|
5
|
-
|
|
6
|
-
DESCRIPTION = """A backup utility for QEMU, KVM, XEN, and Virtualbox guests.
|
|
7
|
-
Virt-back is a python application that uses the libvirt api to safely
|
|
8
|
-
shutdown, gzip, and restart guests. The backup process logs to syslog
|
|
9
|
-
for auditing and virt-back works great with cron for scheduling outages.
|
|
10
|
-
Virt-back has been placed in the public domain and
|
|
11
|
-
the latest version may be downloaded here:
|
|
12
|
-
https://git.unturf.com/python/virt-back
|
|
13
|
-
"""
|
|
14
|
-
|
|
15
|
-
setup(
|
|
16
|
-
name="virt-back",
|
|
17
|
-
version="0.2.1",
|
|
18
|
-
description="virt-back: A backup utility for QEMU, KVM, XEN, and Virtualbox guests",
|
|
19
|
-
keywords="backup virtual hypervisor QEMU KVM XEN Virtualbox",
|
|
20
|
-
long_description=DESCRIPTION,
|
|
21
|
-
author="Russell Ballestrini",
|
|
22
|
-
author_email="russell@ballestrini.net",
|
|
23
|
-
url="https://git.unturf.com/python/virt-back",
|
|
24
|
-
platforms=["All"],
|
|
25
|
-
license="Public Domain",
|
|
26
|
-
py_modules=["virtback"],
|
|
27
|
-
include_package_data=True,
|
|
28
|
-
scripts=["virt-back"],
|
|
29
|
-
)
|
|
30
|
-
|
|
31
|
-
"""
|
|
32
|
-
setup()
|
|
33
|
-
keyword args: http://peak.telecommunity.com/DevCenter/setuptools
|
|
34
|
-
|
|
35
|
-
configure pypi username and password in ~/.pypirc::
|
|
36
|
-
|
|
37
|
-
[pypi]
|
|
38
|
-
username:
|
|
39
|
-
password:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
build and upload to pypi with this::
|
|
43
|
-
|
|
44
|
-
python setup.py sdist bdist_egg register upload
|
|
45
|
-
"""
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: virt-back
|
|
3
|
-
Version: 0.2.1
|
|
4
|
-
Summary: virt-back: A backup utility for QEMU, KVM, XEN, and Virtualbox guests
|
|
5
|
-
Home-page: https://git.unturf.com/python/virt-back
|
|
6
|
-
Author: Russell Ballestrini
|
|
7
|
-
Author-email: russell@ballestrini.net
|
|
8
|
-
License: Public Domain
|
|
9
|
-
Keywords: backup virtual hypervisor QEMU KVM XEN Virtualbox
|
|
10
|
-
Platform: All
|
|
11
|
-
|
|
12
|
-
A backup utility for QEMU, KVM, XEN, and Virtualbox guests.
|
|
13
|
-
Virt-back is a python application that uses the libvirt api to safely
|
|
14
|
-
shutdown, gzip, and restart guests. The backup process logs to syslog
|
|
15
|
-
for auditing and virt-back works great with cron for scheduling outages.
|
|
16
|
-
Virt-back has been placed in the public domain and
|
|
17
|
-
the latest version may be downloaded here:
|
|
18
|
-
https://git.unturf.com/python/virt-back
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|