0

我已经浏览了这个LINK,它解释了如何设置 Affinity 控件,以便 nova 负责将节点放置在基于Server Group.

我面临的问题是 - 我打算通过 python 代码来实现通过自动化更好地控制。

在探索novaclient 1.1 python 模块 doc时,我只将availability_zones其视为create()方法的参数。这有关系Affinity Server Group吗?通过阅读更多关于它的内容 - 它看起来不是那样的。

create(name, image, flavor, meta=None, files=None, reservation_id=None, min_count=None, max_count=None, security_groups=None, userdata=None, key_name=None, availability_zone=None, block_device_mapping=None, block_device_mapping_v2=None, nics=None, scheduler_hints=None, config_drive=None, disk_config=None, **kwargs)
Create (boot) a new server.

Parameters: 
name – Something to name the server.
image – The Image to boot with.
flavor – The Flavor to boot onto.
meta – A dict of arbitrary key/value metadata to store for this server. A maximum of five entries is allowed, and both keys and values must be 255 characters or less.
files – A dict of files to overrwrite on the server upon boot. Keys are file names (i.e. /etc/passwd) and values are the file contents (either as a string or as a file-like object). A maximum of five entries is allowed, and each file must be 10k or less.
userdata – user data to pass to be exposed by the metadata server this can be a file type object as well or a string.
reservation_id – a UUID for the set of servers being requested.
key_name – (optional extension) name of previously created keypair to inject into the instance.
availability_zone – Name of the availability zone for instance placement.
block_device_mapping – (optional extension) A dict of block device mappings for this server.
block_device_mapping_v2 – (optional extension) A dict of block device mappings for this server.
nics – (optional extension) an ordered list of nics to be added to this server, with information about connected networks, fixed ips, port etc.
scheduler_hints – (optional extension) arbitrary key-value pairs specified by the client to help boot an instance
config_drive – (optional extension) value for config drive either boolean, or volume-id
disk_config – (optional extension) control how the disk is partitioned when the server is created. possible values are ‘AUTO’ or ‘MANUAL’.

我很难处理文档并在调用create().

我想了解:

  • 如何创建Server Groups亲和力?任何地方都没有这方面的文档。
  • 如何将其与create()控制亲和力的方法联系起来?
4

0 回答 0