I've read the annexes to the spec. Here are some suggested changes. Sorry, this is quite a long post! I thought it would be best put here, since it focuses on the VMs, rather than in the installation spec thread.
Installation Specification, Page 21 wrote:Code: Select all
VBoxManage" storageattach "[GuestOsMachineName]" --storagectl "SATA" --port 1 --device 0 --nonrotational on --discard on --medium "[file.vdi]" --type hdd
There's a typo in my original text: an extra quote, near the beginning. It should read:
Code: Select all
VBoxManage storageattach "[GuestOsMachineName]" --storagectl "SATA" --port 1 --device 0 --nonrotational on --discard on --medium "[file.vdi]" --type hdd
Installation Specification, Page 22 wrote:It is suggested that anything that looked like it might be remotely relevant to Python development or which might affect the way the system behaves or operates in normal use should be installed.
I think this is probably a bit unclear, and that probably comes from how I wrote it originally. I read it as meaning that I should install all of the Python development packages from the repository, which is not what it means!
I think we're missing a statement of the intent behind the comparision. So, just after the commands for comparing the packages, I'd insert the instruction "Install and remove packages in Debian to try to minimise the differences between Debian and Raspbian lite." That way, a context is established for properly understanding the subsequent notes.
Installation Specification, Page 23 wrote:Using Section 4.4.1.1.2 of this document as a guide install any package present in Debian.
May I suggest "Install the additional Python modules needed for Software Framework. Use Section 4.4.1.1.2 of this document as a guide, but omit packages not present in Debian."
Installation Specification, Page 23 wrote:Edit /etc/fstab to add the discard option to the root filesystem, to reduce the size of the virtual disk image when files have been deleted.
Note: Trimming reduced the size of the virtual disk by about 700MB.
The 700MB reduction is not instant after adding the discard option. I think it's very important to recommend running the command "fstrim -a" on the virtual machine, which will force the process to occur straight away. Otherwise, you might be waiting a long time before any reduction in the virtual disk size occurs, or you might go on to finalise the base image without the reduction in size having occurred. Finalising the base image (i.e. making it multi-attach) before its filesystem has been trimmed would be a really bad idea because not only would the larger size of the base image be "locked in", but, when the individual Pi VMs do eventually trim their filesystems, there will end up being very large differences between the Pis and the base image, resulting in very sizeable difference images, which would completely defeat the object of using "discard" to save disk space!
Installation Specification, Page 23 wrote:Since this involves detaching and reattaching the disk image on the "base image" VM, remember to re-attach it using the VBoxManage command with the --detach=on option, as above.
There was an error in my original text. There is no "--detach=on" option; I meant "--discard on". Different word and no equals sign. Those two words sound very similar in my head!
There is a slight inconsistency within VirtualBox here; the command you run to enable this option has "--discard on", whereas the resulting XML file contains "discard=true". Hence, I referred, with intent, to both "on" and "true" in various places. (i.e. I was specifically referring to either the XML or to the VBoxManage command. It might be worth reviewing the text for this, as I suspect some of the distinction may be lost and people may wonder why it's inconsistent.
I've omitted to explain HOW to make the image multi-attach (and it is "multi-attach", not "multi-use", but for some reason my fingers keep wanting to type "use").
To configure the base disk image as multi-attach, the process is:
- Go into VirtualBox's Virtual Media Manager, and locate the base disk image. Select it, click "Detach", click "Modify" and select "Multi-attach".
- Re-attach it to the base image by running the VBoxManage command with the --discard on option, as above.
Installation Specification, Page 23 wrote:Having created the base image VM and configured the base disk image as multi-use, it's then possible to clone the VM. Select the option to reinitialise the MAC addresses of the nework interfaces, and create a Linked clone. This automatically almost everything needed, and preserves the discard=true configuration on the storage. However, it results in a chain of snapshots on the base image VM. These cannot be easily removed afterwards.
Note: It might be better to create a new VM without a disk, configure it as required, clone it and then attach the disks.
I would definitely change that "might be better" note into the main instruction:
- Create a new "clonable" VM with an identical configuration to the base image VM, but having no attached virtual disk.
- Clone the clonable VM as many times as necessary to create each individual Pi VM, selecting the option to renitialise the MAC addresses of the network interfaces. Since the clonable VM has no disk, it makes no difference whether you choose to create a Full or Linked clone.
- After creating the clones, attach the base image individually to each cloned VM, using VBoxManage with the appropriate VM name and "--discard=on"
- Remove the clonable VM, or keep it to hand for producing further clones.
This will produce exactly the same result without having to deal with removing unwanted snapshots.
Installation Specification, Page 25 wrote:Configure *no* swap space in the partitioner.
Is this correct for the NAS? I thought it had a swap partition, but I must admit I haven't checked, so I could be totally wrong there.
I don't think you can say that trimming will reduce the size of the NAS disk image by about 700MB, because that will depend on a lot of factors during the OS and software installation.
Installation Specification, Page 26 wrote:Packaging VMs for Distribution
The option to export a virtual appliance in .ova format exists. However, this converts all the disk images to .vmdk format, each its own copy. Multi-attach does not seem to get carried over.
Multi-attach does not get carried over. (It's a certainty.)
Installation Specification, Page 26 wrote:Nevertheless, the images are smaller than other methods. For distribution, they are compressed to about 500MB per VM, but they expand to about 1.5GB per VM. The resulting .ova file is 5.5GB and would need to be transported on a medium with a filesystem that supports files that large. (i.e. not FAT32).
This is misleading when taken out of context. It implies that exporting a virtual appliance creates the smallest possible images, which is categorically untrue!
When I said the images are smaller than other methods, I was referring to the fact that using multi-attach and discard in the original VMs results in a smaller virtual appliance than you would get if you hadn't used those features, even though the virtual appliance doesn't actually support them. It just benefits slightly from the legacy of having used them to set up the VM initially. The virtual appliance export will never produce images small enough to upload to the file server.
Installation Specification, Page 26 wrote:Another option would be to copy the machine files themselves, manually, into a compressed archive. This might not carry over to another system well; it needs to be tested.
This would now be my recommended method for packaging the VMs for distribution. It's the one I ended up using, and the one which is being assumed by the instructions in Annex C. Use the process that has been described under "Final Activities" to organise the VMs into a single directory with relative file paths in the XML, then use your preferred archiving utility to create a compressed archive of that directory. Experimentally, 7z format was found to have the best compression.
Installation Specification, Page 27 wrote:Make a snapshot of each VM without the framework. The new snapshot for the current state was added to the basic image's XML definition with an absolute reference, so this needs to be changed to relative for distribution.
Change past tense to future tense "The new snapshot for the current state
will be added to the basic image's XML definition with an absolute reference"
Installation Specification, Page 27 wrote:If a graphical file manager was used to move the files, ensure that it hasn’t left ‘.desktop’ files
Another similar-sounding-word mistake I made: I these are actually ".directory" files. Dolphin uses them to store the view settings for the current folder, so if you view the directory and change the view mode away from the default, then a .directory file will appear in it. They probably won't harm anything if left in place, but I think it's messy to leave them there. Tools more sophisticated than scp can exclude them from being copied in the first place, if you specify a pattern to exclude. (e.g. I think rsync can do that)
Installation Specification, Page 27 wrote:Run:
Code: Select all
systemctl edit [email protected] and add the lines
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin pi %I $TERM
This is not one command. It should be split up like this:
Run:
and add the lines
Code: Select all
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin pi %I $TERM
Installation Specification, Page 29 wrote:You can change the settings on each machine to match it.
Each
virtual machine, that is. (Not each host machine that runs the VMs.)