【问题标题】:Openstack Neutron: How to update port vif-model using update_port() apiOpenstack Neutron:如何使用 update_port() api 更新端口 vif-model
【发布时间】:2015-07-21 11:09:14
【问题描述】:

我想更新已创建端口的 vif_model。我在 CLI 中使用以下命令

neutron port-update --binding:vif_model=avp <port_id>

如何使用 neutron 的 python apis 实现相同的目的。 我正在尝试使用 update_port() api。但不确定参数。

>>> from neutronclient.neutron import client
>>> neutron = client.Client('2.0', endpoint_url=neutron_endpoint, token=tok)
>>> help(neutron.update_port)

给出以下提示:

模块 neutronclient.v2_0.client 中的函数 with_params 的帮助:

with_params(*args, **kwargs)

【问题讨论】:

  • 这是一个有效的命令行吗?查看API reference,我看到对binding:vnic_typebinding:host_idbinding:profile 的支持,但对binding:vif_model 没有任何支持。
  • 我正在使用 Windriver Openstack Havana 版本。这是 windriver 对端口的补充,因为它们支持加速虚拟端口 (avp)

标签: python openstack openstack-neutron


【解决方案1】:

我查看了Nova 源代码,以了解通常如何使用update_port 调用的示例,看起来您可以这样称呼它:

client.update_port('1fe691a6-f3a0-4586-b126-9fabb11e962a',
                   {'port': 
                     {'binding:vif_type': 'avp'}})

【讨论】:

    猜你喜欢
    • 2019-01-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多