|
|
@@ -205,7 +205,7 @@ class InstanceService(PageableObjectMixin, CloudService):
|
|
|
pass
|
|
|
|
|
|
@abstractmethod
|
|
|
- def create(self, name, image, instance_type, subnet=None, zone=None,
|
|
|
+ def create(self, name, image, instance_type, subnet, zone=None,
|
|
|
key_pair=None, security_groups=None, user_data=None,
|
|
|
launch_config=None,
|
|
|
**kwargs):
|
|
|
@@ -224,33 +224,39 @@ class InstanceService(PageableObjectMixin, CloudService):
|
|
|
the instance to boot into
|
|
|
|
|
|
:type subnet: ``Subnet`` or ``str``
|
|
|
- :param subnet: The Subnet object or a subnet string ID with which the
|
|
|
- instance should be associated. If no subnet was
|
|
|
- specified, this method will attempt to find a 'default'
|
|
|
- network and launch the instance using that network (or
|
|
|
- subnet, as appropriate by the provider). A 'default'
|
|
|
- network is one tagged as such by the native API. If such
|
|
|
- tag or functionality does not exist, an attempt to
|
|
|
- create a new network (by default called
|
|
|
- 'CloudBridgeNet') will be made. If that falls through,
|
|
|
- an attempt will be made to launch the instance without
|
|
|
- specifying the network parameter (this is under the
|
|
|
- assumption the private networking functionality is not
|
|
|
- available on the provider).
|
|
|
+ :param subnet: The subnet object or a subnet string ID with which the
|
|
|
+ instance should be associated. The subnet is a mandatory
|
|
|
+ parameter, and must be provided when launching an
|
|
|
+ instance.
|
|
|
+
|
|
|
+ Note: Older clouds (with classic networking), may not
|
|
|
+ have proper subnet support and are not guaranteed to
|
|
|
+ work. Some providers (e.g. OpenStack) support a null
|
|
|
+ value but the behaviour is implementation specific.
|
|
|
|
|
|
:type zone: ``Zone`` or ``str``
|
|
|
:param zone: The Zone or its name, where the instance should be placed.
|
|
|
+ This parameter is provided for legacy compatibility (with
|
|
|
+ classic networks).
|
|
|
+
|
|
|
+ The subnet's placement zone will take precedence over this
|
|
|
+ parameter, but in its absence, this value will be used.
|
|
|
|
|
|
:type key_pair: ``KeyPair`` or ``str``
|
|
|
:param key_pair: The KeyPair object or its name, to set for the
|
|
|
instance.
|
|
|
|
|
|
:type security_groups: A ``list`` of ``SecurityGroup`` objects or a
|
|
|
- list of ``str`` names
|
|
|
+ list of ``str`` object IDs
|
|
|
:param security_groups: A list of ``SecurityGroup`` objects or a list
|
|
|
- of ``SecurityGroup`` names, which should be
|
|
|
+ of ``SecurityGroup`` IDs, which should be
|
|
|
assigned to this instance.
|
|
|
|
|
|
+ The security groups must be associated with the
|
|
|
+ same network as the supplied subnet. Use
|
|
|
+ ``network.security_groups`` to retrieve a list
|
|
|
+ of security groups belonging to a network.
|
|
|
+
|
|
|
:type user_data: ``str``
|
|
|
:param user_data: An extra userdata object which is compatible with
|
|
|
the provider.
|