【OpenStack】稼働中のインスタンスでOpenStackコマンド

毎度毎度コントローラーにログインするのもあれなので,インスタンスとして動いていてメインで使っているCentOSでOpenStackコマンドを叩くようにするメモ。

参考サイト

How to Install Pip on CentOS 7
Install the OpenStack command-line clients

■ PIP入れる準備

1. EPEL リポジトリ登録

# rpm -iUvh https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm

2. gccインストール
# yum install gcc

3. setuptoolsインストール
# wget https://bootstrap.pypa.io/ez_setup.py -O – | sudo python

4. pipインストール
# yum install python-devel python-pip

■ OpenStackクライアントインストール

# pip install python-openstackclient
# pip install python-neutronclient (何故かneutronコマンドだけ入っていなかった)

以上。

これで基本こっちでいじればよくなった。
ホスト側にあまり領域割かなかったから,イメージ登録とか楽になったわ。

【OpenStack】CentOS7でファイルサーバ立てたけどやたらとスループットが悪い

使っていたNASの容量がもうパンパンだったので,大量にDisk詰んだRDOにCentOS7をたててファイルサーバとしてNAS代わりにした。

が,やったらと速度が出ない。
ファイル移行で8Mbps程度しか出ていない。

で,「Neutron 速度がでない」とかでぐぐってみると,大体同じ事象がたくさん出てくる。

NICにトラフィック処理をオフロードしていることが原因のようで。

ここらを参考にGROをOFFにした。

・ Slow network speed between VM and external
・ NICのオフロード機能を無効にする

    $ ethtool -k enp4s0
    Features for enp4s0:
    rx-checksumming: on
    tx-checksumming: off
            tx-checksum-ipv4: off
            tx-checksum-ip-generic: off [fixed]
            tx-checksum-ipv6: off
            tx-checksum-fcoe-crc: off [fixed]
            tx-checksum-sctp: off [fixed]
    scatter-gather: off
            tx-scatter-gather: off
            tx-scatter-gather-fraglist: off [fixed]
    tcp-segmentation-offload: off
            tx-tcp-segmentation: off
            tx-tcp-ecn-segmentation: off [fixed]
            tx-tcp6-segmentation: off
    udp-fragmentation-offload: off [fixed]
    generic-segmentation-offload: off [requested on]
    generic-receive-offload: on
    large-receive-offload: off [fixed]
    rx-vlan-offload: on
    tx-vlan-offload: on
    ntuple-filters: off [fixed]
    receive-hashing: off [fixed]
    highdma: off [fixed]
    rx-vlan-filter: off [fixed]
    vlan-challenged: off [fixed]
    tx-lockless: off [fixed]
    netns-local: off [fixed]
    tx-gso-robust: off [fixed]
    tx-fcoe-segmentation: off [fixed]
    tx-gre-segmentation: off [fixed]
    tx-ipip-segmentation: off [fixed]
    tx-sit-segmentation: off [fixed]
    tx-udp_tnl-segmentation: off [fixed]
    fcoe-mtu: off [fixed]
    tx-nocache-copy: off
    loopback: off [fixed]
    rx-fcs: off
    rx-all: off
    tx-vlan-stag-hw-insert: off [fixed]
    rx-vlan-stag-hw-parse: off [fixed]
    rx-vlan-stag-filter: off [fixed]
    l2-fwd-offload: off [fixed]
    busy-poll: off [fixed]

    $ sudo ethtool -K enp4s0 gro off
    $ ethtool -k enp4s0
    Features for enp4s0:
    rx-checksumming: on
    tx-checksumming: off
            tx-checksum-ipv4: off
            tx-checksum-ip-generic: off [fixed]
            tx-checksum-ipv6: off
            tx-checksum-fcoe-crc: off [fixed]
            tx-checksum-sctp: off [fixed]
    scatter-gather: off
            tx-scatter-gather: off
            tx-scatter-gather-fraglist: off [fixed]
    tcp-segmentation-offload: off
            tx-tcp-segmentation: off
            tx-tcp-ecn-segmentation: off [fixed]
            tx-tcp6-segmentation: off
    udp-fragmentation-offload: off [fixed]
    generic-segmentation-offload: off [requested on]

    generic-receive-offload: off   # OFFになった

    これで転送やりなおしたら200Mbpsくらいまで改善された。100Mbpsでした。
    しかし,これって再起動したらまた戻るんだっけか?

    rcスクリプトとかにethtoolを仕込んでおかないとダメっぽい。

    Turning off GRO on startup
    ・ How to persist ethtool settings through reboot

    # /etc/sysconfig/network-scripts/ifcfg-enp4s0
    ETHTOOL_OPTS=”gro off”

    これでどうかしら。

    NAT除外設定

    Cisco IOSでNAT設定を入れている時に,特定のセグメントへの通信のみNATさせずに実アドレスで通信させる設定のメモ。

    単純にaccess-listのPermitの前段に除外したいACLを入れてあげればよいかと思いきや,うまくいかない。
    どうしたらいいかというと,Route-Mapを使う。

    ! ACL設定

    ip access-list extended No_NAT
    deny ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255
    permit ip 192.168.1.0 0.0.0.255 any

    ! Route-Map設定
    route-map RM_NAT permit 10

    match ip address No_NAT

    ! NAT設定
    ip nat inside source route-map RM_NAT pool VLAN1