Give a minimum size (2GB) of swap area through lvm method

19 views
Skip to first unread message

Sumit Sharma

unread,
Nov 20, 2017, 12:26:28 AM11/20/17
to Packer
While building Ubuntu_16.04 image through packer, I have to do partitioning in preseed file such that the method used is LVM and the minimum size of swap area must be 2GB. Currently, the VM is giving the swap area same as the size of the RAM given as input. If RAM is 1GB , the swap area created by default is also 1GB. This I have to change and put it minimum to 2GB.

 Current Pressed file-
d-i partman-auto/method string lvm
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-auto/expert_recipe string                       \
    boot-root ::                                            \
            512 50 1024 ext3                                \
                    $primary{ } $bootable{ }                \
                    method{ format } format{ }              \
                    use_filesystem{ } filesystem{ ext3 }    \
                    mountpoint{ /boot }                     \
            .                                               \
            50000 10000 1000000000 ext3                     \
                    lv_name{ root }                         \
                    method{ lvm } format{ }                 \
                    use_filesystem{ } filesystem{ ext4 }    \
                    mountpoint{ / }                         \
                    $lvmok{ }                               \
            .                                               \
            2148 512 200% linux-swap                        \
                    lv_name{ swap }                         \
                    method{ swap } format{ }                \
                    $lvmok                                  \
            .
d-i     partman-partitioning/confirm_write_new_label boolean true
d-i     partman/choose_partition select finish
d-i     partman/confirm boolean true
d-i     partman/confirm_nooverwrite boolean true

This code is not working to restrict swap size to minimum of 2GB.

Alvaro Miranda Aguilera

unread,
Nov 20, 2017, 4:42:56 AM11/20/17
to packe...@googlegroups.com
Hello

Are you using a server iso? some non-server issues doesn't honor some of the configurations options.

It seems more a ubuntu question rather than packer, perhaps you can try reach canonical?

alvaro.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/3f6cb45e-223d-4f1e-b0e6-527bf4984126%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Sumit Sharma

unread,
Nov 20, 2017, 11:40:13 PM11/20/17
to Packer
I am using a server iso. I will ask it on ubuntu forums then.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.



--
Alvaro

Reply all
Reply to author
Forward
0 new messages