高危操作 :

    以fsp用户登录控制节点
    image.png
    su - root 切换到root用户后导入环境变量

    1:云平台上查看业务虚拟机的ID
    image.png
    2:nova interface-list fbbff44d-a3e8-4575-8f67-1246307026b6

    1. 39372A03-8688-72A7-E911-805486341B42:~ # nova interface-list fbbff44d-a3e8-4575-8f67-1246307026b6
    2. +------------+--------------------------------------+--------------------------------------+----------------+-------------------+
    3. | Port State | Port ID | Net ID | IP addresses | MAC Addr |
    4. +------------+--------------------------------------+--------------------------------------+----------------+-------------------+
    5. | ACTIVE | 97b426b7-732a-4665-b5ad-c3f140ff4b19 | 4aaabf56-f34d-495b-8b5d-0e7f1fe0fb1b | 10.182.211.243 | fa:16:3e:ed:5e:9c |
    6. +------------+--------------------------------------+--------------------------------------+----------------+-------------------+
    7. 39372A03-8688-72A7-E911-805486341B42:~ #
    8. 39372A03-8688-72A7-E911-805486341B42:~ #
    9. 39372A03-8688-72A7-E911-805486341B42:~ #

    3:找到对应的要删除的PortID后,执行网卡与虚拟机解绑操作;
    执行命令: nova interface-detach **虚拟机ID PortID**
    nova interface-detach fbbff44d-a3e8-4575-8f67-1246307026b6 97b426b7-732a-4665-b5ad-c3f140ff4b19

    再次检查
    nova interface-list fbbff44d-a3e8-4575-8f67-1246307026b6

    1. 39372A03-8688-72A7-E911-805486341B42:~ # nova interface-detach fbbff44d-a3e8-4575-8f67-1246307026b6 97b426b7-732a-4665-b5ad-c3f140ff4b19
    2. 39372A03-8688-72A7-E911-805486341B42:~ # nova interface-list fbbff44d-a3e8-4575-8f67-1246307026b6
    3. +------------+---------+--------+--------------+----------+
    4. | Port State | Port ID | Net ID | IP addresses | MAC Addr |
    5. +------------+---------+--------+--------------+----------+
    6. +------------+---------+--------+--------------+----------+
    7. 39372A03-8688-72A7-E911-805486341B42:~ #
    8. 39372A03-8688-72A7-E911-805486341B42:~ #

    image.png

    4:添加新网卡
    解绑后,在SC上查看虚拟机信息为虚拟机重新添加新网卡,然后返回在后面级联层控制节点主机上,查看当前添加的新网卡是否为主网卡

    image.png
    5:检查新网卡信息
    查看网卡是否为主网卡命令:neutron port-show PortID

    1. 39372A03-8688-72A7-E911-805486341B42:~ # nova interface-list fbbff44d-a3e8-4575-8f67-1246307026b6
    2. +------------+--------------------------------------+--------------------------------------+----------------+-------------------+
    3. | Port State | Port ID | Net ID | IP addresses | MAC Addr |
    4. +------------+--------------------------------------+--------------------------------------+----------------+-------------------+
    5. | ACTIVE | 0f067519-6e9a-4178-a7cc-2b614d837d6a | ab44a2db-9d7a-42fe-9f49-9d1e966987b7 | 10.182.212.157 | fa:16:3e:d9:d0:bc |
    6. +------------+--------------------------------------+--------------------------------------+----------------+-------------------+
    7. 39372A03-8688-72A7-E911-805486341B42:~ # neutron port-show 0f067519-6e9a-4178-a7cc-2b614d837d6a
    8. +-----------------------+------------------------------------------------------------------------------------------------------------------------+
    9. | Field | Value |
    10. +-----------------------+------------------------------------------------------------------------------------------------------------------------+
    11. | admin_state_up | True |
    12. | allowed_address_pairs | |
    13. | binding:host_id | 44454C4C-3000-105A-8044-B1C04F345932 |
    14. | binding:profile | {"availability_zone": "az2.dc0"} |
    15. | binding:vif_details | {"ovs_hybrid_plug": true, "primary_interface": true, "port_filter": true, "mtu_request": false} |
    16. | binding:vif_type | ovs |
    17. | binding:vnic_type | normal |
    18. | binding_levels | {"driver": "huawei_ac_ml2", "level": 0, "physical_network": "", "network_type": "vxlan", "segmentation_id": 99382} |
    19. | | {"driver": "openvswitch", "level": 1, "physical_network": "physnet2", "network_type": "vlan", "segmentation_id": 1011} |
    20. | created_at | 2020-11-06T08:48:53 |
    21. | description | |
    22. | device_id | fbbff44d-a3e8-4575-8f67-1246307026b6 |
    23. | device_owner | compute:az2.dc0 |
    24. | extra_dhcp_opts | |
    25. | fixed_ips | {"subnet_id": "ee245829-b9b0-4c00-a882-b9f88397f7eb", "ip_address": "10.182.212.157"} |
    26. | id | 0f067519-6e9a-4178-a7cc-2b614d837d6a |
    27. | mac_address | fa:16:3e:d9:d0:bc |
    28. | name | |
    29. | network_id | ab44a2db-9d7a-42fe-9f49-9d1e966987b7 |
    30. | port_security_enabled | True |
    31. | project_id | 314fe0973e804ceaaa8ca7879fcc3857 |
    32. | qos_policy_id | |
    33. | security_groups | 50c386be-3290-4c9d-b7fe-70faf5841b59 |
    34. | status | ACTIVE |
    35. | tags | |
    36. | tenant_id | 314fe0973e804ceaaa8ca7879fcc3857 |
    37. | updated_at | 2020-11-06T08:49:07 |
    38. +-----------------------+------------------------------------------------------------------------------------------------------------------------+
    39. 39372A03-8688-72A7-E911-805486341B42:~ #

    6:检查新网卡信息
    查看回显信息,admin_state_up字段是否为true,true为主网卡,反之不是
    如新加网卡不是主网卡,则需要为当前网卡添加主网卡属性
    命令:neutron port-update PortID admin_state_up True