zoukankan      html  css  js  c++  java
  • 创建多网卡虚拟机

    Azure可以创建多网卡的虚拟机。在IDC内的机器采用多网卡的主要功能有:

    1. 提供冗余连接

    2. 增加性能

    3. 不同网卡采用不同功能

    4. VM需要有不同网段的IP(比如虚拟防火墙、虚拟路由器等)

    在公有云上,由于云的特性,不用考虑冗余连接和性能的问题。所以只有在第三种情况或第四种情况下,有可能会用到多网卡的虚拟机。

    Multi NIC for VM

    Azure上不同型号的虚拟机可以支持不同数量的网卡:

    [在此处输入文章标题]

     

     

    VM Size (Standard SKUs)

    NICs (max allowed per VM)

    All Basic Sizes

    1

    A0extra small

    1

    A1small

    1

    A2medium

    1

    A3large

    2

    A4extra large

    4

    A5

    1

    A6

    2

    A7

    4

    A8

    2

    A9

    4

    A10

    2

    A11

    4

    D1

    1

    D2

    2

    D3

    4

    D4

    8

    D11

    2

    D12

    4

    D13

    8

    D14

    8

    DS1

    1

    DS2

    2

    DS3

    4

    DS4

    8

    DS11

    2

    DS12

    4

    DS13

    8

    DS14

    8

    D1_v2

    1

    D2_v2

    2

    D3_v2

    4

    D4_v2

    8

    D5_v2

    8

    D11_v2

    2

    D12_v2

    4

    D13_v2

    8

    D14_v2

    8

    G1

    1

    G2

    2

    G3

    4

    G4

    8

    G5

    8

    All Other Sizes

    1

     

     基本上遵循下面的规则:A系列机器,网卡数量是CPU数量除以2,最大4块网卡:D、DS、G系列机器,网卡数量是CPU的数量,最大8块网卡。

    创建多网卡虚拟机,只能通过Powershell或者Azure CLI来实现。

    1. Powershell:

    New-AzureVMConfig -Name hweasttest -InstanceSize Large -ImageName $vmimg[-1].ImageName | Add-AzureProvisioningConfig -Linux -LinuxUser hengwei -Password xxxxxxxx | Set-AzureSubnet -SubnetNames Subnet-1 | Add-AzureNetworkInterfaceConfig -Name nic2 -SubnetName Subnet-1 -IPForwarding Enabled | New-AzureVM -ServiceName hweasttest -Location "China East" -VNetName "hwvnet" 

    2. Azure CLI

    azure vm create -l "China East" -z Large -n hwmnic02 -e 22222 -w hwvnet -b Subnet-1 -f nic2:Subnet-1::: -c hwmnic f1179221e23b4dbb89e39d70e5bc9e72__OpenLogic-CentOS-66-20150128 hengwei xxxxxxxx
    info:    Executing command vm create
    + Looking up image f1179221e23b4dbb89e39d70e5bc9e72__OpenLogic-CentOS-66-20150128
    + Looking up virtual network                                                   
    + Looking up cloud service                                                     
    warn:    —location option will be ignored
    + Getting cloud service properties                                             
    + Looking up deployment                                                        
    + Retrieving storage accounts                                                  
    + Creating VM                                                                  
    info:    vm create command OK

    CentOS的机器启动后,会只显示eth0,需要手工配置eth1。

    在目录/etc/sysconfig/network-scripts中复制ifcfg-eth0到ifcfg-eth1,其配置如下:

    ifcfg-eth0 
    DHCP_HOSTNAME=linux-vm1
    DEVICE=eth0
    ONBOOT=yes
    DHCP=yes
    BOOTPROTO=dhcp
    TYPE=Ethernet
    USERCTL=no
    PEERDNS=yes
    IPV6INIT=no
    
    ifcfg-eth1
    DEVICE=eth1
    ONBOOT=yes
    DHCP=yes
    BOOTPROTO=dhcp
    TYPE=Ethernet
    USERCTL=no
    PEERDNS=yes
    IPV6INIT=no

    路由需要在network文件中编辑,/etc/sysconfig/network:

    HOSTNAME=linux-vm1
    NETWORKING=yes
    GATEWAY=192.168.6.1
  • 相关阅读:
    leetcode bugfree note
    leetcode 419
    leetcode 165
    leetcode 155
    leetcode 204
    leetcode 28
    将二叉搜索树转为有序双向链表
    leetcode 397
    ABAP 动态内表创建/赋值
    ABAP 屏幕下拉框值根据选择框填值赋值
  • 原文地址:https://www.cnblogs.com/hengwei/p/5369588.html
Copyright © 2011-2022 走看看