Giter VIP home page Giter VIP logo

f5-packer-templates's Introduction

f5-packer-templates

Packer templates that can be used to build BIG-IP Vagrant boxes from BIG-IP ISOs

About

These directories contain packer templates that you can use to build BIG-IP images for things such as Virtualbox or other tools that you might use.

The requirements to build these Vagrant boxes is nothing more than what is already available on F5's downloads.f5.com site. If you have access to that, then you have access to the necessary ISOs needed to make Vagrant boxes.

The output of these templates is VE instances and the audience here that I am targeting is specifically those who need to develop something against a BIG-IP.

If you are familiar with a BIG-IPs licensing restrictions and Vagrant, you will say to yourself

but BIG-IP wont accept my license when I 'vagrant up' a second time

And you will be right!

There are three options here

  • Get iWorkflow and buy a pool of licenses to activate against
  • Use a single license and call F5 support every time you need to 'vagrant up'
  • Request that F5 begin selling "recycleable" developer licenses

Those options are all probably less than ideal, but I don't make the rules.

Support

I guarantee that you will find no help from F5 official support. I'm putting this repository out there simply as a proof of concept.

If something does not work, you're free to raise Issues in Github here, but I may not respond to them immediately, or at all.

Instructions

Refer to the README.md files in each of the template directories. Some of the templates seem "more verbose" than they should be. This is due to either a bug in BIG-IP, packer, or my local system where tmsh commands seem to stop returning exit codes after a reboot.

Third party tools

Some of the older images (pre 12.0.0) required the inclusion of some third party open source tools

Those tools are not needed by later images because later code either included them already, or did not need them because sufficiently updated copies already existed.

More releases

If/when F5 releases Vagrant boxes on downloads.f5.com, then this repository may largely become obsolete. This isn't likely to happen anytime soon though.

As new releases of BIG-IP happen (Hotfixes and major releases) I will update the packer templates here. Do not expect a new template to land until after the official F5 release.

If you have interest in a release that is not found in this repo, and is listed as supported by F5 at our releases SOL5903 page here

Then open an issue on Github and I will address it.

Required packer version

I always use the latest version, so use that. I build these images on a Mac. YMMV on other platforms, but it should work.

f5-packer-templates's People

Contributors

caphrim007 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

f5-packer-templates's Issues

Packer Failing on VBox Power down

Went through the entire build sequence only to fail on the last step, unsure what the issue. Man the build process is slow (not your fault). My gut says to attempt to reattach the ISO once the first reboot happens.

packer --version
1.3.1
==> Some builds didn't complete successfully and had errors:
--> BIGIP-13.0.0.0.0.1645: Error detaching ISO: VBoxManage error: VBoxManage: error: Failed to get a console object from the direct session (VBOX_E_INVALID_OBJECT_STATE)
VBoxManage: error: Details: code VBOX_E_VM_ERROR (0x80bb0003), component MachineWrap, interface IMachine, callee nsISupports
VBoxManage: error: Context: "LockMachine(a->session, LockType_Shared)" at line 336 of file VBoxManageStorageController.cpp

Cannot connect to mcpd

Hi,

While creating a 11.6.0 box with Packer, I get this error:

2017/10/20 09:31:41 ui: ==> BIGIP-11.6.0.0.0.401: Provisioning with shell script: scripts/save-bigip-conf.sh
==> BIGIP-11.6.0.0.0.401: Provisioning with shell script: scripts/save-bigip-conf.sh
2017/10/20 09:31:41 packer: 2017/10/20 09:31:41 Opening scripts/save-bigip-conf.sh for reading
2017/10/20 09:31:41 packer: 2017/10/20 09:31:41 [INFO] 34 bytes written for 'uploadData'
2017/10/20 09:31:41 [INFO] 34 bytes written for 'uploadData'
2017/10/20 09:31:41 packer: 2017/10/20 09:31:41 opening new ssh session
2017/10/20 09:31:41 packer: 2017/10/20 09:31:41 Starting remote scp process:  scp -vt /tmp
2017/10/20 09:31:41 packer: 2017/10/20 09:31:41 Started SCP session, beginning transfers...
2017/10/20 09:31:41 packer: 2017/10/20 09:31:41 Copying input data into temporary file so we can read the length
2017/10/20 09:31:42 packer: 2017/10/20 09:31:42 [DEBUG] scp: Uploading script_6443.sh: perms=C0644 size=34
2017/10/20 09:31:42 packer: 2017/10/20 09:31:42 SCP session complete, closing stdin pipe.
2017/10/20 09:31:42 packer: 2017/10/20 09:31:42 Waiting for SSH session to complete.
2017/10/20 09:31:42 packer: 2017/10/20 09:31:42 scp stderr (length 30): Sink: C0644 34 script_6443.sh
2017/10/20 09:31:42 packer: 2017/10/20 09:31:42 opening new ssh session
2017/10/20 09:31:42 packer: 2017/10/20 09:31:42 starting remote command: chmod 0755 /tmp/script_6443.sh
2017/10/20 09:31:42 packer: 2017/10/20 09:31:42 [INFO] RPC endpoint: Communicator ended with: 0
2017/10/20 09:31:42 [INFO] RPC client: Communicator ended with: 0
2017/10/20 09:31:42 [INFO] RPC endpoint: Communicator ended with: 0
2017/10/20 09:31:42 packer: 2017/10/20 09:31:42 [INFO] RPC client: Communicator ended with: 0
2017/10/20 09:31:42 packer: 2017/10/20 09:31:42 opening new ssh session
2017/10/20 09:31:42 packer: 2017/10/20 09:31:42 starting remote command: chmod +x /tmp/script_6443.sh; PACKER_BUILDER_TYPE='virtualbox-iso' PACKER_BUILD_NAME='BIGIP-11.6.0.0.0.401'  /tmp/script_6443.sh
2017/10/20 09:31:42 ui:     BIGIP-11.6.0.0.0.401: Cannot connect to mcpd. Your preferences and aliases will not be available until it comes back up.
    BIGIP-11.6.0.0.0.401: Cannot connect to mcpd. Your preferences and aliases will not be available until it comes back up.
2017/10/20 09:31:42 ui:     BIGIP-11.6.0.0.0.401: The connection to mcpd has been lost, try again.
    BIGIP-11.6.0.0.0.401: The connection to mcpd has been lost, try again.
2017/10/20 09:31:42 packer: 2017/10/20 09:31:42 Remote command exited with '1': chmod +x /tmp/script_6443.sh; PACKER_BUILDER_TYPE='virtualbox-iso' PACKER_BUILD_NAME='BIGIP-11.6.0.0.0.401'  /tmp/script_6443.sh
2017/10/20 09:31:42 packer: 2017/10/20 09:31:42 [INFO] RPC endpoint: Communicator ended with: 1
2017/10/20 09:31:42 [INFO] 0 bytes written for 'stdout'
2017/10/20 09:31:42 [INFO] 148 bytes written for 'stderr'
2017/10/20 09:31:42 [INFO] RPC client: Communicator ended with: 1
2017/10/20 09:31:42 [INFO] RPC endpoint: Communicator ended with: 1
2017/10/20 09:31:42 packer: 2017/10/20 09:31:42 [INFO] 0 bytes written for 'stdout'
2017/10/20 09:31:42 packer: 2017/10/20 09:31:42 [INFO] 148 bytes written for 'stderr'
2017/10/20 09:31:42 packer: 2017/10/20 09:31:42 [INFO] RPC client: Communicator ended with: 1
2017/10/20 09:31:42 [INFO] (telemetry) ending shell
2017/10/20 09:31:42 [INFO] (telemetry) found error: Script exited with non-zero exit status: 1
2017/10/20 09:31:43 packer: 2017/10/20 09:31:43 Executing VBoxManage: []string{"controlvm", "BIGIP-11.6.0.0.0.401", "poweroff"}
2017/10/20 09:31:43 packer: 2017/10/20 09:31:43 stdout:
2017/10/20 09:31:43 packer: 2017/10/20 09:31:43 stderr: 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
2017/10/20 09:31:43 packer: 2017/10/20 09:31:43 Executing VBoxManage: []string{"storageattach", "BIGIP-11.6.0.0.0.401", "--storagectl", "IDE Controller", "--port", "0", "--device", "1", "--medium", "none"}
2017/10/20 09:31:43 packer: 2017/10/20 09:31:43 stdout:
2017/10/20 09:31:43 packer: 2017/10/20 09:31:43 stderr:
2017/10/20 09:31:43 ui: ==> BIGIP-11.6.0.0.0.401: Unregistering and deleting virtual machine...
==> BIGIP-11.6.0.0.0.401: Unregistering and deleting virtual machine...
2017/10/20 09:31:43 packer: 2017/10/20 09:31:43 Executing VBoxManage: []string{"unregistervm", "BIGIP-11.6.0.0.0.401", "--delete"}
2017/10/20 09:31:45 packer: 2017/10/20 09:31:45 stdout:
2017/10/20 09:31:45 packer: 2017/10/20 09:31:45 stderr: 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
2017/10/20 09:31:45 ui: ==> BIGIP-11.6.0.0.0.401: Deleting output directory...
==> BIGIP-11.6.0.0.0.401: Deleting output directory...
2017/10/20 09:31:45 [INFO] (telemetry) ending virtualbox-iso
2017/10/20 09:31:45 [INFO] (telemetry) found error: Script exited with non-zero exit status: 1
2017/10/20 09:31:45 ui error: Build 'BIGIP-11.6.0.0.0.401' errored: Script exited with non-zero exit status: 1
2017/10/20 09:31:45 Builds completed. Waiting on interrupt barrier...
2017/10/20 09:31:45 machine readable: error-count []string{"1"}
2017/10/20 09:31:45 ui error: 
==> Some builds didn't complete successfully and had errors:
2017/10/20 09:31:45 machine readable: BIGIP-11.6.0.0.0.401,error []string{"Script exited with non-zero exit status: 1"}
2017/10/20 09:31:45 ui error: --> BIGIP-11.6.0.0.0.401: Script exited with non-zero exit status: 1
2017/10/20 09:31:45 ui: 
==> Builds finished but no artifacts were created.
2017/10/20 09:31:45 [INFO] (telemetry) Finalizing.
Build 'BIGIP-11.6.0.0.0.401' errored: Script exited with non-zero exit status: 1

==> Some builds didn't complete successfully and had errors:
--> BIGIP-11.6.0.0.0.401: Script exited with non-zero exit status: 1

==> Builds finished but no artifacts were created.
2017/10/20 09:31:45 waiting for all plugin processes to complete...
2017/10/20 09:31:45 /usr/local/packer/packer: plugin process exited
2017/10/20 09:31:45 /usr/local/packer/packer: plugin process exited
2017/10/20 09:31:45 /usr/local/packer/packer: plugin process exited
2017/10/20 09:31:45 [ERR] Error decoding response stream 27: EOF
2017/10/20 09:31:45 [ERR] Error decoding response stream 26: EOF
2017/10/20 09:31:45 /usr/local/packer/packer: plugin process exited
2017/10/20 09:31:45 [ERR] Error decoding response stream 25: EOF
2017/10/20 09:31:45 /usr/local/packer/packer: plugin process exited
Makefile:20: recipe for target 'all' failed
make: *** [all] Error 1

I'm running Packer 1.1.1 and Virtualbox 5.0.

Thank you.

Comma missing in bigip-11.6.0-hf6-x86_64-box/template.json

I got this error when I tried to build the 11.6.0 HF6 box (bigip-11.6.0-hf6-x86_64-box):

$ packer build template.json
Failed to parse template: Error parsing JSON: invalid character '"' after object key:value pair
At line 9, column 8 (offset 190):
    8:       "name": "BIGIP-11.6.0.6.0.442.HF6"
    9:       "
             ^

It appears that a comma is missing at line 8 of the "template.json" file.

Thank you.

Script disconnected unexpectedly

Hi Tim,

I'm trying to create a 11.6.0 box with Packer 1.1.1 and Virtualbox 5.0 on Ubuntu 16.04, but a get a "Script disconnected unexpectedly" error.

$ packer version
Packer v1.1.1

$ vboxmanage --version
5.0.40_Ubuntur115130

The problem occurs while running the "vagrant.sh" script:

...
2017/10/20 08:43:36 ui: ==> BIGIP-11.6.0.0.0.401: Provisioning with shell script: scripts/vagrant.sh
==> BIGIP-11.6.0.0.0.401: Provisioning with shell script: scripts/vagrant.sh
2017/10/20 08:43:36 packer: 2017/10/20 08:43:36 Opening scripts/vagrant.sh for reading
2017/10/20 08:43:36 packer: 2017/10/20 08:43:36 opening new ssh session
2017/10/20 08:43:36 [INFO] 1310 bytes written for 'uploadData'
2017/10/20 08:43:36 packer: 2017/10/20 08:43:36 [INFO] 1310 bytes written for 'uploadData'
2017/10/20 08:43:36 packer: 2017/10/20 08:43:36 Starting remote scp process:  scp -vt /tmp
2017/10/20 08:43:36 packer: 2017/10/20 08:43:36 Started SCP session, beginning transfers...
2017/10/20 08:43:36 packer: 2017/10/20 08:43:36 Copying input data into temporary file so we can read the length
2017/10/20 08:43:36 packer: 2017/10/20 08:43:36 [DEBUG] scp: Uploading script_2296.sh: perms=C0644 size=1310
2017/10/20 08:43:41 packer: 2017/10/20 08:43:41 SCP session complete, closing stdin pipe.
2017/10/20 08:43:41 packer: 2017/10/20 08:43:41 Waiting for SSH session to complete.
2017/10/20 08:43:41 packer: 2017/10/20 08:43:41 scp stderr (length 86): error: mcpd never came up... using /config/BigDB.dat.
2017/10/20 08:43:41 packer: Sink: C0644 1310 script_2296.sh
2017/10/20 08:43:41 packer: 2017/10/20 08:43:41 opening new ssh session
2017/10/20 08:43:41 packer: 2017/10/20 08:43:41 starting remote command: chmod 0755 /tmp/script_2296.sh
2017/10/20 08:43:41 packer: 2017/10/20 08:43:41 [INFO] RPC endpoint: Communicator ended with: 0
2017/10/20 08:43:41 [INFO] RPC client: Communicator ended with: 0
2017/10/20 08:43:41 [INFO] RPC endpoint: Communicator ended with: 0
2017/10/20 08:43:41 packer: 2017/10/20 08:43:41 [INFO] RPC client: Communicator ended with: 0
2017/10/20 08:43:41 packer: 2017/10/20 08:43:41 opening new ssh session
2017/10/20 08:43:41 packer: 2017/10/20 08:43:41 starting remote command: chmod +x /tmp/script_2296.sh; PACKER_BUILDER_TYPE='virtualbox-iso' PACKER_BUILD_NAME='BIGIP-11.6.0.0.0.401'  /tmp/script_2296.sh
    BIGIP-11.6.0.0.0.401: Saving running configuration...
2017/10/20 08:43:43 ui:     BIGIP-11.6.0.0.0.401: Saving running configuration...
2017/10/20 08:43:43 ui:     BIGIP-11.6.0.0.0.401:   /config/bigip.conf
    BIGIP-11.6.0.0.0.401:   /config/bigip.conf
2017/10/20 08:43:43 ui:     BIGIP-11.6.0.0.0.401:   /config/bigip_base.conf
    BIGIP-11.6.0.0.0.401:   /config/bigip_base.conf
2017/10/20 08:43:43 ui:     BIGIP-11.6.0.0.0.401:   /config/bigip_user.conf
    BIGIP-11.6.0.0.0.401:   /config/bigip_user.conf
2017/10/20 08:43:43 ui:     BIGIP-11.6.0.0.0.401: Saving Ethernet mapping...done
    BIGIP-11.6.0.0.0.401: Saving Ethernet mapping...done
2017/10/20 08:43:45 ui:     BIGIP-11.6.0.0.0.401: Saving running configuration...
    BIGIP-11.6.0.0.0.401: Saving running configuration...
2017/10/20 08:43:45 ui:     BIGIP-11.6.0.0.0.401:   /config/bigip.conf
    BIGIP-11.6.0.0.0.401:   /config/bigip.conf
2017/10/20 08:43:45 ui:     BIGIP-11.6.0.0.0.401:   /config/bigip_base.conf
    BIGIP-11.6.0.0.0.401:   /config/bigip_base.conf
2017/10/20 08:43:45 ui:     BIGIP-11.6.0.0.0.401:   /config/bigip_user.conf
    BIGIP-11.6.0.0.0.401:   /config/bigip_user.conf
2017/10/20 08:43:46 ui:     BIGIP-11.6.0.0.0.401: Saving Ethernet mapping...done
    BIGIP-11.6.0.0.0.401: Saving Ethernet mapping...done
2017/10/20 08:44:18 packer: 2017/10/20 08:44:18 Remote command exited without exit status or exit signal.
2017/10/20 08:44:18 packer: 2017/10/20 08:44:18 [INFO] RPC endpoint: Communicator ended with: 2300218
2017/10/20 08:44:18 [INFO] 272 bytes written for 'stdout'
2017/10/20 08:44:18 [INFO] 0 bytes written for 'stderr'
2017/10/20 08:44:18 [INFO] RPC client: Communicator ended with: 2300218
2017/10/20 08:44:18 [INFO] RPC endpoint: Communicator ended with: 2300218
2017/10/20 08:44:18 packer: 2017/10/20 08:44:18 [INFO] 272 bytes written for 'stdout'
2017/10/20 08:44:18 packer: 2017/10/20 08:44:18 [INFO] 0 bytes written for 'stderr'
2017/10/20 08:44:18 packer: 2017/10/20 08:44:18 [INFO] RPC client: Communicator ended with: 2300218
2017/10/20 08:44:18 [INFO] (telemetry) ending shell
2017/10/20 08:44:18 [INFO] (telemetry) found error: Script disconnected unexpectedly.
2017/10/20 08:44:18 packer: 2017/10/20 08:44:18 Executing VBoxManage: []string{"controlvm", "BIGIP-11.6.0.0.0.401", "poweroff"}
2017/10/20 08:44:19 packer: 2017/10/20 08:44:19 stdout:
2017/10/20 08:44:19 packer: 2017/10/20 08:44:19 stderr: 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
2017/10/20 08:44:19 packer: 2017/10/20 08:44:19 Executing VBoxManage: []string{"storageattach", "BIGIP-11.6.0.0.0.401", "--storagectl", "IDE Controller", "--port", "0", "--device", "1", "--medium", "none"}
2017/10/20 08:44:19 packer: 2017/10/20 08:44:19 stdout:
2017/10/20 08:44:19 packer: 2017/10/20 08:44:19 stderr:
2017/10/20 08:44:19 ui: ==> BIGIP-11.6.0.0.0.401: Unregistering and deleting virtual machine...
==> BIGIP-11.6.0.0.0.401: Unregistering and deleting virtual machine...
2017/10/20 08:44:19 packer: 2017/10/20 08:44:19 Executing VBoxManage: []string{"unregistervm", "BIGIP-11.6.0.0.0.401", "--delete"}
2017/10/20 08:44:20 packer: 2017/10/20 08:44:20 stdout:
2017/10/20 08:44:20 packer: 2017/10/20 08:44:20 stderr: 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
2017/10/20 08:44:20 ui: ==> BIGIP-11.6.0.0.0.401: Deleting output directory...
==> BIGIP-11.6.0.0.0.401: Deleting output directory...
2017/10/20 08:44:20 [INFO] (telemetry) ending virtualbox-iso
2017/10/20 08:44:20 [INFO] (telemetry) found error: Script disconnected unexpectedly.
2017/10/20 08:44:20 ui error: Build 'BIGIP-11.6.0.0.0.401' errored: Script disconnected unexpectedly.
2017/10/20 08:44:20 Builds completed. Waiting on interrupt barrier...
2017/10/20 08:44:20 machine readable: error-count []string{"1"}
2017/10/20 08:44:20 ui error: 
==> Some builds didn't complete successfully and had errors:
2017/10/20 08:44:20 machine readable: BIGIP-11.6.0.0.0.401,error []string{"Script disconnected unexpectedly."}
2017/10/20 08:44:20 ui error: --> BIGIP-11.6.0.0.0.401: Script disconnected unexpectedly.
2017/10/20 08:44:20 ui: 
==> Builds finished but no artifacts were created.
2017/10/20 08:44:20 [INFO] (telemetry) Finalizing.
Build 'BIGIP-11.6.0.0.0.401' errored: Script disconnected unexpectedly.

==> Some builds didn't complete successfully and had errors:
--> BIGIP-11.6.0.0.0.401: Script disconnected unexpectedly.

==> Builds finished but no artifacts were created.
2017/10/20 08:44:21 waiting for all plugin processes to complete...
2017/10/20 08:44:21 /usr/local/packer/packer: plugin process exited
2017/10/20 08:44:21 /usr/local/packer/packer: plugin process exited
2017/10/20 08:44:21 /usr/local/packer/packer: plugin process exited
2017/10/20 08:44:21 /usr/local/packer/packer: plugin process exited
2017/10/20 08:44:21 /usr/local/packer/packer: plugin process exited
Makefile:20: recipe for target 'all' failed
make: *** [all] Error 1

It is related to a backwards incompatible change in Packer regarding scripts causing the ssh session to be disconnected. See this thread:

hashicorp/packer#4684

provisioner/shell: Set default for ExpectDisconnect to false. If your script causes the connection to be reset, you should set this to true to prevent errors. [GH-5283]

Setting ExpectDisconnect to true fix the issue. However, I get an other error when saving the config. I'll open a separate bug report.

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.