openstack 给虚拟机添加网卡

openstack 给虚拟机添加网卡

######下面标颜色的地方需要替换为需要新建的接口IP和所属的网络名称
##创建接口
neutron port-create --fixed-ip ip_address=192.168.3.226 public ###将接口绑定到虚拟机 nova interface-attach --port-id $(neutron port-list --network_id=$(neutron net-list |grep public |awk '{print $2}') |grep '192.168.3.226"' |awk '{print $2}') $(nova list |grep web-3 |awk '{print $2}') ###查看虚拟机的接口信息 nova interface-list $(nova list |grep web-3 |awk '{print $2}')

猜你喜欢

转载自www.cnblogs.com/blog-lhong/p/11834627.html
今日推荐