ef14eaaf5e
Migrating from rackspace/gophercloud to gophercloud/gophercloud library. Change-Id: Ia72a4c548e23b4225b788520d924be8e04ce5c6f
1.5 KiB
1.5 KiB
Appendix
Bootstrap your network
Most cloud providers provision all network objects that are required to boot an instance. To determine whether these objects were created for you, access the Network Topology section of the OpenStack dashboard.
Specify a network during instance build
code for creating a networking using code
shade
Add the parameter network and send its name or id to attach the instance to:
= conn.create_server(wait=True, auto_ip=True,
testing_instance =instance_name,
name=image_id,
image=flavor_id,
flavor=network_id) network
gophercloud
Add the option Networks and send its id to attach the instance to:
:= servers.CreateOpts {
opts : instanceName,
Name: image.ID,
ImageRef: flavor.ID,
FlavorRef: []string{securityGroupName},
SecurityGroups: []byte(userData),
UserData: []servers.Network{servers.Network{UUID: networkID}},
Networks
}
, _ = servers.Create(client, keypairs.CreateOptsExt {
testingInstance: opts,
CreateOptsBuilder: keyPairName,
KeyName}).Extract()