Shrink the openstack image using packer

28 views
Skip to first unread message

Narasimha Reddy

unread,
Oct 30, 2017, 9:16:38 AM10/30/17
to Packer
Hello Guys,

I'm trying to get a customized image out of an oracle linux image on openstack using packer. i.e run some scripts on the instance and extract the image
It works. however the size of the image produced by packer is same as the size of the flavor selected.

Example: If I use m1.small flavor, then I get a 20 GB image. BTW the source image's size is 2 GB only.

Is there a way I can specify the final image's size using packer?

This is how my current json file looks like:

{
  "builders": [{
    "type": "openstack",
    "identity_endpoint":"http://my_openstack:5000/v3",
    "tenant_name": "tenant_1",
    "domain_name": "default",
    "username": "user1",
    "password": "xxxx",
    "ssh_username": "user",
    "image_name": "my-packer",
    "source_image": "93670fc0-bab6-4304-85d1-1c50ba",
    "flavor": "m1.small",
    "security_groups": ["default"],
    "floating_ip_pool": "ext-net",
    "networks": ["6c06e963-72dc-47ac-8ecb-c62a5b45"],
    "insecure": true
  }],
  "provisioners": [{
    "type": "shell",
    "inline": [
  " sudo ./my_custom_script.sh"
    ]
  }]



Packer version: 1.1.1

Any help would be highly appreciated.
Reply all
Reply to author
Forward
0 new messages