virt-back 0.2.1__tar.gz → 0.2.2__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.
@@ -0,0 +1,141 @@
1
+ Metadata-Version: 2.1
2
+ Name: virt-back
3
+ Version: 0.2.2
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
+ How to backup zfs snapshot all KVM instances on a TrueNAS Scale,
73
+
74
+ ```
75
+ 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
76
+
77
+ shutdown: invoking shutdown on 1_akuma
78
+ shutdown: waited 0 seconds for 1_akuma to shut off
79
+ backup: invoking backup for 1_akuma
80
+ backup: checking if /dev/zvol/downloads/akuma-tfjpo7 is a ZFS dataset
81
+ backup: downloads/akuma-tfjpo7 is a ZFS dataset
82
+ backup: creating ZFS snapshot downloads/akuma-tfjpo7@backup-2024-07-07-2 for 1_akuma
83
+ 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
84
+ backup: skipping ISO file /mnt/downloads/iso/ubuntu-24.04-live-server-amd64.iso for 1_akuma
85
+ create: invoking create on 1_akuma
86
+ backup: rotating backup files for 1_akuma
87
+ backup: archiving files for 1_akuma to /mnt/personal/backup/virt-back/1_akuma.tar
88
+ backup: archiving /mnt/personal/backup/virt-back/1_akuma.xml for 1_akuma
89
+ backup: checking if /dev/zvol/downloads/akuma-tfjpo7 is a ZFS dataset
90
+ backup: downloads/akuma-tfjpo7 is a ZFS dataset
91
+ backup: archiving /mnt/personal/backup/virt-back/1_akuma-2024-07-07.zfs for 1_akuma
92
+ backup: finished backup for 1_akuma
93
+ ```
94
+
95
+ ## Restoring from a ZFS Backup
96
+
97
+ 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.
98
+
99
+ ### Step-by-Step Restore Process
100
+
101
+ 1. **Extract the Backup Archive**: Extract the tar archive to get the ZFS snapshot file and the XML configuration file.
102
+ 2. **Restore the ZFS Snapshot to a New Dataset**: Use the `zfs receive` command to restore the ZFS snapshot to a new dataset.
103
+ 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.
104
+
105
+ ### Detailed Steps
106
+
107
+ #### 1. Extract the Backup Archive
108
+
109
+ 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.
110
+
111
+ ```bash
112
+ tar -xvf /mnt/personal/backup/virt-back/1_akuma.tar --strip-components=4 -C /mnt/personal/backup/virt-back
113
+ ```
114
+
115
+ This command will extract the files directly to the `/mnt/personal/backup/virt-back` directory, removing the leading directory components.
116
+
117
+ #### 2. Restore the ZFS Snapshot to a New Dataset
118
+
119
+ 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`:
120
+
121
+ ```bash
122
+ zfs receive -F downloads/akuma-tfjpo7-restored < /mnt/personal/backup/virt-back/1_akuma-2024-07-07.zfs
123
+ ```
124
+
125
+ This command will restore the ZFS snapshot to the `downloads/akuma-tfjpo7-restored` dataset.
126
+
127
+ #### 3. Create a New VM in TrueNAS Scale
128
+
129
+ 1. **Open TrueNAS Scale UI**: Log in to the TrueNAS Scale web interface.
130
+ 2. **Navigate to Virtual Machines**: Go to the "Virtual Machines" section.
131
+ 3. **Create a New VM**:
132
+ - Click on "Add" to create a new VM.
133
+ - Fill in the necessary details for the new VM (e.g., name, CPU, memory).
134
+ 4. **Attach the Restored ZFS Volume**:
135
+ - In the "Disks" section, add a new disk.
136
+ - Select "Existing Zvol" and choose the restored ZFS volume (`downloads/akuma-tfjpo7-restored`).
137
+ 5. **Complete the VM Creation**: Finish the VM creation process by following the remaining steps in the UI.
138
+
139
+ ### Summary
140
+
141
+ 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,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.2",
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,141 @@
1
+ Metadata-Version: 2.1
2
+ Name: virt-back
3
+ Version: 0.2.2
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
+ How to backup zfs snapshot all KVM instances on a TrueNAS Scale,
73
+
74
+ ```
75
+ 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
76
+
77
+ shutdown: invoking shutdown on 1_akuma
78
+ shutdown: waited 0 seconds for 1_akuma to shut off
79
+ backup: invoking backup for 1_akuma
80
+ backup: checking if /dev/zvol/downloads/akuma-tfjpo7 is a ZFS dataset
81
+ backup: downloads/akuma-tfjpo7 is a ZFS dataset
82
+ backup: creating ZFS snapshot downloads/akuma-tfjpo7@backup-2024-07-07-2 for 1_akuma
83
+ 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
84
+ backup: skipping ISO file /mnt/downloads/iso/ubuntu-24.04-live-server-amd64.iso for 1_akuma
85
+ create: invoking create on 1_akuma
86
+ backup: rotating backup files for 1_akuma
87
+ backup: archiving files for 1_akuma to /mnt/personal/backup/virt-back/1_akuma.tar
88
+ backup: archiving /mnt/personal/backup/virt-back/1_akuma.xml for 1_akuma
89
+ backup: checking if /dev/zvol/downloads/akuma-tfjpo7 is a ZFS dataset
90
+ backup: downloads/akuma-tfjpo7 is a ZFS dataset
91
+ backup: archiving /mnt/personal/backup/virt-back/1_akuma-2024-07-07.zfs for 1_akuma
92
+ backup: finished backup for 1_akuma
93
+ ```
94
+
95
+ ## Restoring from a ZFS Backup
96
+
97
+ 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.
98
+
99
+ ### Step-by-Step Restore Process
100
+
101
+ 1. **Extract the Backup Archive**: Extract the tar archive to get the ZFS snapshot file and the XML configuration file.
102
+ 2. **Restore the ZFS Snapshot to a New Dataset**: Use the `zfs receive` command to restore the ZFS snapshot to a new dataset.
103
+ 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.
104
+
105
+ ### Detailed Steps
106
+
107
+ #### 1. Extract the Backup Archive
108
+
109
+ 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.
110
+
111
+ ```bash
112
+ tar -xvf /mnt/personal/backup/virt-back/1_akuma.tar --strip-components=4 -C /mnt/personal/backup/virt-back
113
+ ```
114
+
115
+ This command will extract the files directly to the `/mnt/personal/backup/virt-back` directory, removing the leading directory components.
116
+
117
+ #### 2. Restore the ZFS Snapshot to a New Dataset
118
+
119
+ 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`:
120
+
121
+ ```bash
122
+ zfs receive -F downloads/akuma-tfjpo7-restored < /mnt/personal/backup/virt-back/1_akuma-2024-07-07.zfs
123
+ ```
124
+
125
+ This command will restore the ZFS snapshot to the `downloads/akuma-tfjpo7-restored` dataset.
126
+
127
+ #### 3. Create a New VM in TrueNAS Scale
128
+
129
+ 1. **Open TrueNAS Scale UI**: Log in to the TrueNAS Scale web interface.
130
+ 2. **Navigate to Virtual Machines**: Go to the "Virtual Machines" section.
131
+ 3. **Create a New VM**:
132
+ - Click on "Add" to create a new VM.
133
+ - Fill in the necessary details for the new VM (e.g., name, CPU, memory).
134
+ 4. **Attach the Restored ZFS Volume**:
135
+ - In the "Disks" section, add a new disk.
136
+ - Select "Existing Zvol" and choose the restored ZFS volume (`downloads/akuma-tfjpo7-restored`).
137
+ 5. **Complete the VM Creation**: Finish the VM creation process by following the remaining steps in the UI.
138
+
139
+ ### Summary
140
+
141
+ 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.
@@ -6,4 +6,5 @@ virtback.py
6
6
  virt_back.egg-info/PKG-INFO
7
7
  virt_back.egg-info/SOURCES.txt
8
8
  virt_back.egg-info/dependency_links.txt
9
+ virt_back.egg-info/requires.txt
9
10
  virt_back.egg-info/top_level.txt
@@ -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