summaryrefslogtreecommitdiff
path: root/morphlib/exts/kvm.write
Commit message (Collapse)AuthorAgeFilesLines
* Refere to .write.help file for documentationPete Fotheringham2014-11-281-1/+5
|
* Document the write extension in the write.help filePete Fotheringham2014-11-261-20/+0
| | | | | - Move docstring from .write to .write.help - Rework the content and formatting of the help information
* Whitespace and line endings?Pete Fotheringham2014-11-251-11/+10
|
* Fix shell quoting for ssh remote command linesLars Wirzenius2014-09-051-3/+5
| | | | Found by Richard Maw.
* Transfer sparse files faster for kvm, vbox deploymentLars Wirzenius2014-09-051-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The KVM and VirtualBox deployments use sparse files for raw disk images. This means they can store a large disk (say, tens or hundreds of gigabytes) without using more disk space than is required for the actual content (e.g., a gigabyte or so for the files in the root filesystem). The kernel and filesystem make the unwritten parts of the disk image look as if they are filled with zero bytes. This is good. However, during deployment those sparse files get transferred as if there really are a lot of zeroes. Those zeroes take a lot of time to transfer. rsync, for example, does not handle large holes efficiently. This change introduces a couple of helper tools (morphlib/xfer-hole and morphlib/recv-hole), which transfer the holes more efficiently. The xfer-hole program reads a file and outputs records like these: DATA 123 binary data (exaclyt 123 bytes and no newline at the end) HOLE 3245 xfer-hole can do this efficiently, without having to read through all the zeroes in the holes, using the SEEK_DATA and SEEK_HOLE arguments to lseek. Using this, the holes take only take a few bytes each, making it possible to transfer a disk image faster. In my benchmarks, transferring a 100G byte disk image took about 100 seconds for KVM, and 220 seconds for VirtualBox (which needs to more work at the receiver to convert the raw disk to a VDI). Both benchmarks were from a VM on my laptop to the laptop itself. The interesting bit here is that the receiver (recv-hole) is simple enough that it can be implemented in a bit of shell script, and the text of the shell script can be run on the remote end by giving it to ssh as a command line argument. This means there is no need to install any special tools on the receiver, which makes using this improvement much simpler.
* deploy: Check SSH connection for KVM deployment before startingSam Thursfield2014-04-141-6/+3
| | | | | | Slight duplication is necessary, but it's only a few lines. We could move the duplicated code into the base class in 'morphlib.writeexts' if there was more duplication.
* Make parse_autostart() into more general get_environment_boolean()Sam Thursfield2014-03-041-2/+2
| | | | | Also, be more flexible when parsing environment booleans -- convert to lower case and match 0/1 and true/false as well as yes/no.
* Deployment failures will now remove the disk imageDan Firth2013-10-141-0/+1
|
* Allow to set the number of cpus for virtualbox and kvm deployments.Tiago Gomes2013-07-021-2/+5
|
* Write extensions: pass -s to rsyncRichard Maw2013-06-091-1/+1
| | | | | | | | | | | | | -s, or --protect-args prevents the file path components of destination or source paths being interpreted by the remote shell. This is for wildcards or other shell features, but it breaks when paths have whitespace. We tend to always use absolute paths, so all uses of rsync now pass -s. kvm.write needs it, since the disk can be written to a path with spaces. Nfsboot and ssh-rsync need it because version labels are used, which may have spaces, and temporary directories are used, which could have spaces in weird TMPDIR configurations.
* kvm.write uses NIC_CONFIGJonathan Maw2013-06-191-0/+5
|
* kvm.write: Set VM to autostart if specifiedJonathan Maw2013-06-031-0/+3
|
* kvm.write: use ssh_runcmdJonathan Maw2013-06-031-4/+3
|
* Fix kvm working without autostartJonathan Maw2013-05-241-1/+1
|
* Add AUTOSTART to kvm and libvirt write extensionsRichard Maw2013-05-081-9/+10
| | | | | | If AUTOSTART is 'yes' then the VM will be started once it is created. If it is 'no' or undefined, then it will need to be manually started. If it is any other value, then an exception is raised.
* Set RAM size for kvm deploymentLars Wirzenius2013-03-281-1/+4
|
* Add ATTACH_DISKS support to kvmLars Wirzenius2013-03-201-1/+8
|
* Improve message phrasingLars Wirzenius2013-02-121-2/+2
| | | | Suggested-By: Richard Maw
* Refactor: Add WriteExtension.create_local_system methodLars Wirzenius2013-02-071-26/+9
| | | | | | | | | | This allows code sharing amongst all the places that create a system in a raw disk image. This also adds the creation of a factory-run subvolume, and fixes error messages for errors that happen during a disk image creation. Suggested-By: Richard Maw Suggested-By: Sam Thursfield
* Remove debugging outputLars Wirzenius2013-02-071-13/+0
| | | | Suggested-By: Richard Maw
* Add a write extension for kvm+libvirtLars Wirzenius2013-02-061-0/+140