如何在创建softlayer vsi期间分配固定的IP地址

How to configure a Fixed ip address while creating a virtual server instead of assigning the dynamic IP address. I used the below code but its not working for me. please suggest a best way to configure the fixed ip address.

code :

    sess := session.New(username, apikey)

// Get the Virtual_Guest service
service := services.GetVirtualGuestService(sess)

// Create a Virtual_Guest struct as a template
vGuestTemplate := datatypes.Virtual_Guest{
    // Set Creation values - use helpers from the sl package to set pointer values.
    // Unset (nil) values are not sent
    Hostname:                     sl.String("test-vim-02"),
    Domain:                       sl.String("test-ibm.com"),
    MaxMemory:                    sl.Int(4096),
    StartCpus:                    sl.Int(4),
    Datacenter:                   &datatypes.Location{Name: sl.String("sjc04")},
    OperatingSystemReferenceCode: sl.String("UBUNTU_LATEST"),
    LocalDiskFlag:                sl.Bool(true),
    PrivateNetworkOnlyFlag:       sl.Bool(true),
    PrimaryBackendIpAddress:      sl.String("10.82.111.48"),
    PrimaryBackendNetworkComponent: &datatypes.Virtual_Guest_Network_Component{
        NetworkVlan: &datatypes.Network_Vlan{
            Id: sl.Int(24L),
        },
        PrimarySubnet: &datatypes.Network_Subnet{
            Id: sl.Int(19L),
        },
        MaxSpeed: sl.Int(1000),
    },
}

// Tell the API to create the virtual guest
newGuest, err := service.CreateObject(&vGuestTemplate)
// optional error checking...
if err != nil {
    log.Fatal(err)
}

// Print the ID of the new guest.  Don't forget to dereference
fmt.Printf("New guest %d created", *newGuest.Id)

Unfortunately you won't be able to configure the ip address while creating the VSI. The provisioning process looks for an available ip address in the subnet an it is assigned to the VSI.

For more information see the following link:

static ip address allocation for public virtual server