Hello Everyone. Well i want to write some information (not a complete backup) from my Virtual Machine to the tape drive, but the VM can''t read it. I guess i need to attach this device to the VM so it can read and write the tape driver but i don''t know how to do that, i found something similar but with a cd: # xm block-list <vm-id> –long # xm block-detach 1 5632 -f # xm block-attach 1 phy:/dev/cdrom /dev/hdc r # eject /dev/cdrom # xm block-attach 1 phy:/dev/sda /dev/hdc r # xm block-detach 1 5632 -f # xm block-attach 1 phy:/dev/cdrom /dev/hdc r But this is for a block device and i need something for a character device. I hope someone can help me I appreciate your help. Ivan. ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Ivan Gonzalez wrote:> Hello Everyone. > > Well i want to write some information (not a complete > backup) from my Virtual Machine to the tape drive, but > the VM can''t read it. > > I guess i need to attach this device to the VM so it > can read and write the tape driver but i don''t know > how to do that, i found something similar but with a > cd: >Save yourself some grief. If the tape drive is being used to write image files, or even directory backups, to a tape drive, you can play some games after the DomU is running to make its internal partitions mountable in Dom0 in read-only mode and do the backup from there. Alternatively, I use "rsnapshot" to backup my virtual OS''s to a drive or LVM partition on Dom0 and use a tape drive on Dom0 for backing up from there. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
> Save yourself some grief. If the tape drive is being used to write image > files, or even directory backups, to a tape drive, you can play some > games after the DomU is running to make its internal partitions > mountable in Dom0 in read-only mode and do the backup from there.Hmmmm. I generally don''t recommend mounting filesystems of running domUs in dom0, even in read-only form: it can confuse the filesystem driver in dom0, potentially leading (in the worst case) to system instability, corrupted data being read for the backup, etc. I imagine there are also potential security implications (e.g. privileged data ending up in unprivileged files) for the guest''s filesystem. Backing up the disk image of a running guest is not ideal either, because it will certainly be in an inconsistent state and need fsck to attempt to repair the damage if you want to mount / boot it in future. The same corruption / security problems apply here too, but it shouldn''t make dom0 or domU unstable at the time of the backup. It''s best to backup disk images of cleanly shutdown guests. Or you could backup the disk of a guest which has been xm save-ed *and* back up the guest''s memory image at the same time. The two together contain all the information needed to consistently read the disk when the guest is resumed, although the disk image can''t be mounted on it''s own (and, if you do, you won''t be able to safely resume the guest afterwards!).> > Well i want to write some information (not a complete > > backup) from my Virtual Machine to the tape drive, but > > the VM can''t read it. > > > > I guess i need to attach this device to the VM so it > > can read and write the tape driver but i don''t know > > how to do that, i found something similar but with a > > cd:You can''t attach a character device to a guest in the same way you''d attach a block device. Your options would probably be: a) use PCI passthrough b) patch your kernels with the experimental SCSI passthrough drivers from xen-devel, then passthrough the tape device (if it''s SCSI) c) attempt to use USB passthrough, if appropriate, if your guest is HVM (i''m not sure this is very performant / reliable, though). For tape backups of files within the guest, I generally recommend using a network based backup program, as if you had another physical host. It''s not optimal but it''s simple and avoids some nasty tripups / complexities involved in trying to do anything cleverer. Cheers, Mark -- Push Me Pull You - Distributed SCM tool (http://www.cl.cam.ac.uk/~maw48/pmpu/) _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Mark Williamson wrote:>> Save yourself some grief. If the tape drive is being used to write image >> files, or even directory backups, to a tape drive, you can play some >> games after the DomU is running to make its internal partitions >> mountable in Dom0 in read-only mode and do the backup from there. >> > > Hmmmm. I generally don''t recommend mounting filesystems of running domUs in > dom0, even in read-only form: it can confuse the filesystem driver in dom0, > potentially leading (in the worst case) to system instability, corrupted data > being read for the backup, etc. I imagine there are also potential security > implications (e.g. privileged data ending up in unprivileged files) for the > guest''s filesystem. >Oh, that''s what LVM snapshots are for! To protect the active filesystem from anything the Dom0 might do while mounting the LVM snapshot.> Backing up the disk image of a running guest is not ideal either, because it > will certainly be in an inconsistent state and need fsck to attempt to repair > the damage if you want to mount / boot it in future. The same corruption / > security problems apply here too, but it shouldn''t make dom0 or domU unstable > at the time of the backup. >See above.> It''s best to backup disk images of cleanly shutdown guests. Or you could > backup the disk of a guest which has been xm save-ed *and* back up the > guest''s memory image at the same time. The two together contain all the > information needed to consistently read the disk when the guest is resumed, > although the disk image can''t be mounted on it''s own (and, if you do, you > won''t be able to safely resume the guest afterwards!). >"Cleanly shutting down guests" is begging to cause issues for systems without high availability, especially databases.> For tape backups of files within the guest, I generally recommend using a > network based backup program, as if you had another physical host. It''s not > optimal but it''s simple and avoids some nasty tripups / complexities involved > in trying to do anything cleverer. > > Cheers, > Mark > >If you''re going that route, I recommend "rsnapshot" or plain old "rsync". If you''re clever, you can do it to the LVM snapshot and speed the heck out of the process, because most of the files are already there! _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
> > Hmmmm. I generally don''t recommend mounting filesystems of running domUs > > in dom0, even in read-only form: it can confuse the filesystem driver in > > dom0, potentially leading (in the worst case) to system instability, > > corrupted data being read for the backup, etc. I imagine there are also > > potential security implications (e.g. privileged data ending up in > > unprivileged files) for the guest''s filesystem. > > Oh, that''s what LVM snapshots are for! To protect the active filesystem > from anything the Dom0 might do while mounting the LVM snapshot.Yes, doing an LVM snapshot in dom0 of the guest''s disk image will make it safely mountable (from the point of view of not upsetting the dom0 or domU filesystem code). It still doesn''t solve the problem of making the guest''s FS consistent, so fsck may be required on the snapshot itself. I guess how much of a problem this is depends on the filesystem. I imagine that ext3, for instance, will generally recover from this pretty well. If the guest is running another filesystem, this might vary (for instance, XFS does not respond well to this sort of thing, I think). But yes, you are right - LVM snapshots are the way to go for consistent guest backups. Not using some kind of snapshotting to back up a live guest would be a very bad plan and I forgot to point this out!> > It''s best to backup disk images of cleanly shutdown guests. Or you could > > backup the disk of a guest which has been xm save-ed *and* back up the > > guest''s memory image at the same time. The two together contain all the > > information needed to consistently read the disk when the guest is > > resumed, although the disk image can''t be mounted on it''s own (and, if > > you do, you won''t be able to safely resume the guest afterwards!). > > "Cleanly shutting down guests" is begging to cause issues for systems > without high availability, especially databases.Absolutely, but I think it''s worth making clear that there are potential problems with naive approaches to backing up guest data - especially for highly available systems. There should really be better mechanisms in Xen to support efficient, consistent backups of guest filesystems without needing a full shutdown. Unfortunately, at the moment the infrastructure isn''t all there (even though most of the required functionality already exists). Shutdown (or potentially an in-guest backup solution) also has the benefit that you can make sure daemons have stopped, saved cached data to files appropriately, etc.> If you''re going that route, I recommend "rsnapshot" or plain old > "rsync". If you''re clever, you can do it to the LVM snapshot and speed > the heck out of the process, because most of the files are already there!Ah! So snapshot the guest, then update the snapshot every so often with an rsync from the guest?. Whilst we''re on the subject my personal favourite backup system is rdiff-backup, which provides compressed, diff-based backups of a filesystem - either locally, or over SSH - and provides "time-travel" capabilities for getting old versions of files. Cheers, Mark -- Push Me Pull You - Distributed SCM tool (http://www.cl.cam.ac.uk/~maw48/pmpu/) _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Mark Williamson wrote:> >> If you''re going that route, I recommend "rsnapshot" or plain old >> "rsync". If you''re clever, you can do it to the LVM snapshot and speed >> the heck out of the process, because most of the files are already there! >> > > Ah! So snapshot the guest, then update the snapshot every so often with an > rsync from the guest?. >Use the LVM snapshot to creatae a local filesystem snapshot on Dom0. This can be done via rsnapshot cleanly, and incremental rsync based snapshots can be done regularly to a related rsnapshot repository.> Whilst we''re on the subject my personal favourite backup system is > rdiff-backup, which provides compressed, diff-based backups of a filesystem - > either locally, or over SSH - and provides "time-travel" capabilities for > getting old versions of files. >I find rsnapshot friendly. rsync.net is providing commercial support for it. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users