Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
AGS Administrator committed Oct 12, 2017
2 parents fbe44f9 + 4f21be0 commit 16c56ab
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .chag.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
addv=yes
sign=yes
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@
### Added

* First release of the backup script

20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,22 @@ Please read the contributing guidelines before starting to work on a patch, writ
~$ virsh shutdown $domain
```

## Make live backup once

The following command makes a live backup of `<domain>` and creates a new archive in the path `<backup-path>/<domain>/<date>-<time>.tar.gz`. Any directory or file that does not exist it will be created.

```
~/libvirt-administration-tools$ ./vm-live-backup.sh <domain> <backup-path>
```

## Set up daily live backups

This is a check list of things that need to be done to make daily backups of a domain. The following steps assume that a domain exists on the same machine, is running 24\*7 and the domain name of the virtualized guest is $domain.
This is a check list of things that need to be done to make daily backups of a domain. The following steps assume that a domain exists on the same machine, is running 24\*7. The domain name of the virtualized guest is `<domain>`. The path where the backup should be stored is `<backup-path>`. Please note that backups will be made to the path `<backup-path>/<domain>/<date-<time>.tar.gz`.

* Clone and checkout the master branch of this repository
* Open crontab editor by executing `crontab -e`
* Add the following line to the cronjobs
* `30 23 * * * /absolute-path-to/libvirt-administration-tools/vm-live-backup.sh $domain`
* `30 23 * * * /absolute-path-to/libvirt-administration-tools/vm-live-backup.sh <domain> <backup-path>`
* Save and exit the editor

# Known issues
Expand All @@ -49,7 +57,7 @@ error: block copy still active: disk 'hda' not ready for pivot yet
Could not merge changes for disk hda of $domain. VM may be in invalid state.
```

This means that the backup was made but all the data that was written to hda of the virtual machine could not be copied over to the base image. The virtual machine keeps writing new data into the image.snapshot file. To prevent undesirable side effects or even collateral damage, live backup refuses to work if a domain points to a drive that is a snapshot. This means that it is necessary to have this fixed to have live backups working again! A live backup will however send an email saying that it refuses to make a live backup.
This means that the backup was made but all the data that was written to hda of the virtual machine could not be copied over to the base image. The virtual machine keeps writing new data into the snapshot image file. To prevent undesirable side effects or even collateral damage, live backup refuses to work if a domain points to a drive that is a snapshot. This means that it is necessary to have this fixed to have live backups working again! A live backup will however send an email saying that it refuses to make a live backup.

Fixing this is quite easy and can ideally be done while the virtual machine still runs by executing the following commands in this order:

Expand All @@ -61,15 +69,15 @@ Fixing this is quite easy and can ideally be done while the virtual machine stil

If the second command fails again, it is necessary to shut down the virtual machine and retry this operation while the virtual machine is offline.

## Virtual machine crashes with a blue screen after migrating the virtual machine to another host
## Windows guest crashes with a blue screen after migrating the virtual machine to another host

If the host machine runs ubuntu and the blue screen shows the following error message:
While attempting to migrate a windows guest from one ubuntu host to another we observed that the guest refused to start up. It crashed with a blue screen that showed the following error message:

```
KMODE_EXCEPTION_NOT_HANDLED
```

this can be caused by KVM because it injects a #GP into the guest if that tries to access an unhandled MSRs. KVM can be configured to ignore unhandled MSRs. To check if KVM on the host computer is configured to ignore unhandled MSRs run:
This can be caused by KVM because it injects a #GP into the guest if that tries to access an unhandled MSRs. KVM can be configured to ignore unhandled MSRs. To check if KVM on the host computer is configured to ignore unhandled MSRs run:

```
cat /sys/modules/kvm/parameters/ignore_msrs
Expand Down

0 comments on commit 16c56ab

Please sign in to comment.