Skip to content

Order ESXi using SoftLayer::BareMetalServerOrder_Package using the wrong vlan #92

Closed

Description

@bttong

Hello,
I'm using SoftLayer::BareMetalServerOrder_Package to order ESXi and it works fine except I don't see the option to specify public and private vlans that I would like the server to join. I see the options to specify private_vlan_id and public_vlan_id in BareMetalServerOrder. Is it possible to do something similar for BareMetalServerOrder_Package?
Thanks.

Activity

  1. SLsthompson commented on Apr 9, 2015

    @SLsthompson
    Collaborator

    It must be possible as the createObject mechanism used by BareMetalServerOrder just uses the same package-based mechanism in implementation. Let me do some research and I will get back with you.

  2. bttong commented on Apr 13, 2015

    @bttong
    Author

    Hi sthompson,
    I'm wondering if you have any update regarding this issue.

  3. SLsthompson commented on Apr 13, 2015

    @SLsthompson
    Collaborator

    I've not received word back from the email I sent. Let me track down the person and ask them directly.

  4. SLsthompson commented on Apr 13, 2015

    @SLsthompson
    Collaborator

    OK. I spoke with an engineer who was able to offer guidance. The technique is pretty straightforward.

    When putting together the order that is sent to placeOrder you need to modify the hardware template provided so that it includes a reference to the id of the VLAN you want to set on the device.

    It's going to look something like this:

    {
        "hardware" =>  [{
            "primaryBackendNetworkComponent" =>  {
                "networkVlanId" => 12345
            },
            "primaryNetworkComponent" => {
                "networkVlanId" => 12345
            }
        }]
    }
    

    You can modify the order template by passing a block to verify or place_order!. That block will be handed the order template and should return a modified template so something like this may work (though realize this was typed into GitHub, and has not gone through Ruby yet:

    bms_order = SoftLayer::BareMetalServerOrder_Package.new()
    bms_order.package = # some product package
    bms_order.hostname = # some host name
    bms_order.domain = # some domain
    
    add_lans = lambda { |order_template|
    order_template['hardware'][0]['primaryBackendNetworkComponent'] = { "networkVlanId" => 12345 }
    order_template
    }
    
    bms_order.verify(&add_lans)
    bms_order.place_order!(&add_lans)
    
  5. bttong commented on Apr 13, 2015

    @bttong
    Author

    Thanks a lot. I will give it a try.

  6. bttong commented on Apr 14, 2015

    @bttong
    Author

    Thanks.

  7. bttong commented on Apr 14, 2015

    @bttong
    Author

    Thanks. I got it to work with your suggestion. I think it would be great to enhance the API to have vlan as SoftLayer::BareMetalServerOrder_Package attribute.

  8. ju2wheels commented on Apr 15, 2015

    @ju2wheels
    Contributor

    @bttong ive added them to both the VirtualServer and BareMetalServer order package wrappers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions