Switch VCP to LVM based partitions
This patch switches qcow builder to build VCP with lvm based
partition inside. The disk split to 3 partitions:
1. 1MB partition needed for GPT
2. 1Gb boot partition
3. LVM partition
On LVM the following list of partitions is created:
* /
* /home
* /tmp
* /var/tmp
* /var/log
* /var/log/audit
Important: this will break default growroot cloudinit functionality.
To grow LVM automatically the foolowing data should be added to
cloudinit user-data.cfg
user_data:
growpart:
mode: auto
devices: ['/dev/vda3']
ignore_growroot_disabled: false
runcmd:
- [ 'pvresize', '/dev/vda3' ]
The name of LVM partition might be changed depending on the disk
model specified in VCP, by default is virtio.
Further partitioning size tuning should be done via linux formula.
Related-Prod: PROD-24537
Change-Id: Ie7699a747e73fd75b71ce8232b51fe97a310de64
diff --git a/ubuntu-16.04/template.json b/ubuntu-16.04/template.json
index 1cfc211..10f84df 100644
--- a/ubuntu-16.04/template.json
+++ b/ubuntu-16.04/template.json
@@ -2,7 +2,7 @@
"variables": {
"user": "root",
"password": "ho5uo7Uome5d",
- "disk_size": "8000",
+ "disk_size": "5000",
"images_cache": "{{ env `PACKER_IMAGES_CACHE` }}",
"ubuntu_baseurl": "{{ env `UBUNTU_BASEURL` }}",
"saltstack_gpg": "{{ env `SALTSTACK_GPG` }}",
@@ -270,35 +270,37 @@
{
"type": "qemu",
"qemuargs": [
- [ "-m", "1024M" ],
- [ "-cdrom", "config-drive/cloudata.iso" ],
+ ["-m", "1024M"],
["-device", "virtio-net,netdev=user.0"],
["-object","rng-random,id=objrng0,filename=/dev/urandom"],
- ["-device", "virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.0,addr=0x10" ]
+ ["-device", "virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.0,addr=0x10"]
],
- "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}",
- "output_directory": "images/{{ user `image_name` }}-qemu-{{ isotime \"200601021504\" }}",
- "format": "qcow2",
- "iso_checksum": "c71d27a86a168f28097bc30004b54c1f",
- "iso_checksum_type": "md5",
- "iso_url": "http://releases.ubuntu.com/16.04.5/ubuntu-16.04.5-server-amd64.iso",
- "iso_target_path": "{{ user `images_cache`}}/ubuntu-16.04.5-server-amd64.iso",
- "disk_image": true,
- "disk_compression": true,
+ "vm_name": "{{ user `image_name` }}",
+ "output_directory": "images/{{ user `image_name`}}",
"accelerator": "kvm",
"disk_size": "{{ user `disk_size`}}",
+ "iso_checksum": "24636fd103a2a43c95659f1c3c63718e",
+ "iso_checksum_type": "md5",
+ "iso_url": "http://releases.ubuntu.com/16.04.5/ubuntu-16.04.5-server-amd64.iso",
+ "iso_target_path": "{{ user `images_cache` }}/ubuntu-16.04.5-server-amd64.iso",
+ "http_directory": "http",
"headless": true,
- "ssh_username": "{{ user `user` }}",
- "ssh_password": "{{ user `password` }}",
- "ssh_host_port_min": 7000,
- "ssh_host_port_max": 7050,
- "shutdown_command": "shutdown -P now",
+ "ssh_username": "{{user `user`}}",
+ "ssh_password": "{{user `password`}}",
+ "shutdown_command": "sync; sudo /sbin/shutdown -hP now",
"boot_wait": "2s",
- "ssh_wait_timeout": "360s",
+ "ssh_wait_timeout": "700s",
"boot_command": [
- "<wait50ms>",
- "<esc><wait>",
- "<enter><wait>",
+ "<enter><wait><f6><esc>",
+ "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
+ "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
+ "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
+ "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
+ "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
+ "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
+ "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
+ "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
+ "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"/install/vmlinuz<wait>",
" auto<wait>",
" console-setup/ask_detect=false<wait>",