Skip to content

Unable to order VS on subnet #1183

@allmightyspiff

Description

@allmightyspiff

When ordering a Virtual Server with --subnet-private or public, the new guest isn't ordered on that subnet (unless by accident).

To reproduce:

slcli -v  vs create -H test01 -D test.com  -f B1_1X2X25 -d tor01 -o   UBUNTU_LATEST_64 --billing hourly --vlan-private 1244599 --subnet-private 1347253

The subnet is passed into generateOrderTemplate

Calling: SoftLayer_Virtual_Guest::generateOrderTemplate(id=None, args=(
{
    'datacenter': {
        'name': u'tor01'
    },
    'domain': 'test.com',
    'hourlyBillingFlag': True,
    'localDiskFlag': None,
    'maxMemory': None,
    'hostname': u'test01',
    'startCpus': None,
    'operatingSystemReferenceCode': u'UBUNTU_LATEST_64',
    'supplementalCreateObjectOptions': {
        'bootMode': None,
        'flavorKeyName': u'B1_1X2X25'
    },
    'primaryBackendNetworkComponent': {
        'networkVlan': {
            'primarySubnet': {
                'id': 1347253
            },
            'id': 1244599
        }
    }
}
)

But, the response, and subsequent call to placeOrder is missing the subnet id.

Calling: SoftLayer_Product_Order::placeOrder(id=None, mask='', filter='None', args=(
{
    u'complexType': u'SoftLayer_Container_Product_Order_Virtual_Guest',
    u'location': u'448994',
    u'presetId': 583,
    u'useHourlyPricing': True,
    u'imageTemplateId': None,
    u'packageId': 1035,
    u'sourceVirtualGuestId': None,
    u'prices': [
       <PRICES GO HERE>
    ],
    u'virtualGuests': [
        {
            u'primaryBackendNetworkComponent': {
                u'networkVlan': {
                    u'id': 1244599
                },
            },
            u'domain': u'test.com',
            u'hostname': u'test01'
        }
    ],
    u'sshKeys': [
    ],
    u'quantity': 1
}
,), limit=None, offset=None))

generateOrderTemplate should be returning that subnet, but is not. So what we need to do is add a check to see if the subnet id was requested, make sure it exists, and add it back if not.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions