OpenStack Networking » History » Version 15
Raphael Cóbe, 27 Jun 2013 13:17
| 1 | 12 | Raphael Cóbe | h1. OpenStack Networking - Netron |
|---|---|---|---|
| 2 | 1 | Thiago Paiva | |
| 3 | 1 | Thiago Paiva | |
| 4 | 13 | Raphael Cóbe | h2. Netron Standard Architecture |
| 5 | 13 | Raphael Cóbe | |
| 6 | 14 | Raphael Cóbe | |
| 7 | 14 | Raphael Cóbe | !http://docs.openstack.org/trunk/openstack-network/admin/content/figures/1/figures/Quantum-PhysNet-Diagram.png! |
| 8 | 14 | Raphael Cóbe | Imagem retirada da Documentação Openstack Network Admin: http://docs.openstack.org/trunk/openstack-network/admin/ |
| 9 | 14 | Raphael Cóbe | |
| 10 | 13 | Raphael Cóbe | * cloud controller host (Cloud Controller Node): quantum-server, nova-api, nova-scheduler, keystone, RabbitMQ, MySQL. |
| 11 | 13 | Raphael Cóbe | * network gateway host (Network Node): quantum-metadata-agent, quantum-dhcp-agent, quantum-l3-agent, quantum-*-plugin-agent |
| 12 | 13 | Raphael Cóbe | * conjunto de hypervisors para rodar VMs. Compute node: nova-compute, quantum-*-plugin-agent |
| 13 | 13 | Raphael Cóbe | |
| 14 | 13 | Raphael Cóbe | > cloud controller host e network gateway host podem ser combinados em uma máquina, porém é recomendado que exista um network gateway host separado para evitar restrições de CPU entre os encaminhamentos realizados pelo quantum-l3-agent e outros serviços OS. |
| 15 | 13 | Raphael Cóbe | |
| 16 | 13 | Raphael Cóbe | * DataNetwork: comunicação de dados dentro da implementação de nuvem. |
| 17 | 13 | Raphael Cóbe | * Management Network: comunicações entre componentes OS. |
| 18 | 13 | Raphael Cóbe | * External Network: oferece acesso à internet à implementação OS. |
| 19 | 13 | Raphael Cóbe | * API Network: expõe todas as APIs do OS, incluindo a Netron API para os tenants. Pode ser a própria rede externa utilizando o recurso de subredes para separação. |
| 20 | 13 | Raphael Cóbe | |
| 21 | 13 | Raphael Cóbe | |
| 22 | 13 | Raphael Cóbe | |
| 23 | 13 | Raphael Cóbe | |
| 24 | 13 | Raphael Cóbe | |
| 25 | 12 | Raphael Cóbe | h2. Neutron Server |
| 26 | 1 | Thiago Paiva | |
| 27 | 12 | Raphael Cóbe | quantum-server: processo principal do Netron. Expõe Netron API e encaminha as requisições de usuário para o plugin. |
| 28 | 1 | Thiago Paiva | |
| 29 | 1 | Thiago Paiva | |
| 30 | 12 | Raphael Cóbe | h2. Agentes |
| 31 | 1 | Thiago Paiva | |
| 32 | 12 | Raphael Cóbe | Agentes enviam mensagens para o Quantum-Server via RPC (rabbitmq ou qpid) ou Netron API padrão (REST). |
| 33 | 1 | Thiago Paiva | |
| 34 | 7 | Thiago Paiva | * plugin agent (quantum-*-agent): roda em cada hypervisor para realizar configuração local do vswitch. Dependente do plugin escolhido. |
| 35 | 7 | Thiago Paiva | * dhcp agent (quantum-dhcp-agent). serviço de DHCP para redes dos tentents. Usado quando as VMs devem receber IP de forma automatizada. Endereços via DHCP. Requer no mínimo dnsmasq 2.59. Configurado especificamente para o plugin utilizado. |
| 36 | 7 | Thiago Paiva | * L3 agent (quantum-l3-agent). Encaminhamento L3/NAT para oferecer acessos as redes externas. Roteador que conecta as redes L2. Fica no Network Node. Usa: Linux IP Stack e IP tables. |
| 37 | 11 | Raphael Cóbe | ** Deve-se garantir que existam rotas entre o serviço de metadata do host e cada rede privada. |
| 38 | 11 | Raphael Cóbe | ** Nós que rodem quantum-l3-agent não devem ter endereços IP especificados manualmente para a NIC conectada a rede externa e sim uma faixa de IPs que poderá ser usada para roteamento. |
| 39 | 11 | Raphael Cóbe | |
| 40 | 10 | Raphael Cóbe | <pre> |
| 41 | 10 | Raphael Cóbe | $ sudo ovs-vsctrl add-br br-ext |
| 42 | 10 | Raphael Cóbe | $ sudo ovs-vsctrl add-port br-ext eth1 |
| 43 | 10 | Raphael Cóbe | </pre> |
| 44 | 1 | Thiago Paiva | |
| 45 | 7 | Thiago Paiva | * não é possível executar ping para IPs fixos. Ao invés disso, usar: router network namespace (qrouter-<UUID>) |
| 46 | 10 | Raphael Cóbe | <pre> $ ip netns exec qrouter-<UUID> ping <fixed ip> </pre> |
| 47 | 1 | Thiago Paiva | |
| 48 | 1 | Thiago Paiva | |
| 49 | 12 | Raphael Cóbe | h2. Netron API |
| 50 | 1 | Thiago Paiva | |
| 51 | 1 | Thiago Paiva | Serviço de redes virtual. Define conexões e endereços para os outros serviços. |
| 52 | 1 | Thiago Paiva | |
| 53 | 2 | Thiago Paiva | * Network: segmento L2 isolado (análogo a uma VLAN). |
| 54 | 7 | Thiago Paiva | * Subnet: bloco de endereços de IP (V4 ou V6) e estados de configuração associados. |
| 55 | 1 | Thiago Paiva | * Port: ponto para conexção de dispositivos. |
| 56 | 1 | Thiago Paiva | <pre> |
| 57 | 1 | Thiago Paiva | network <-- port |
| 58 | 3 | Thiago Paiva | | | |
| 59 | 3 | Thiago Paiva | -------------- subnet |
| 60 | 1 | Thiago Paiva | </pre> |
| 61 | 1 | Thiago Paiva | |
| 62 | 1 | Thiago Paiva | > fixed_ips é atributo do port |
| 63 | 1 | Thiago Paiva | > port.fixed_ips = {<IP1>:<subnet1>, <IP2>:<subnet2>, ...} |
| 64 | 1 | Thiago Paiva | |
| 65 | 1 | Thiago Paiva | |
| 66 | 1 | Thiago Paiva | h2. Netron Plugins |
| 67 | 12 | Raphael Cóbe | |
| 68 | 1 | Thiago Paiva | Projeto original assume um modelo muito básico para realizar isolamento através de Linux VLANs e tabelas IP. Netron introduz o conceito de plugin, que é a |
| 69 | 7 | Thiago Paiva | implementação de requisições lógicas de API em forma de um back-end acoplável. Padrão: Open vSwitch e Linux Bridge. Plugin deve estar em cada nó que usa |
| 70 | 7 | Thiago Paiva | pacotes de dados. |
| 71 | 1 | Thiago Paiva | |
| 72 | 1 | Thiago Paiva | Os plugins devem processar chamadas de API e gerenciar vSwitches. |
| 73 | 8 | Thiago Paiva | |
| 74 | 1 | Thiago Paiva | OpenVSwitch: open vswitch, quantum-plugin-openvswitch-agent |
| 75 | 1 | Thiago Paiva | |
| 76 | 15 | Raphael Cóbe | <pre> |
| 77 | 1 | Thiago Paiva | $ sudo ovs-vsctrl add-br br-int |
| 78 | 15 | Raphael Cóbe | </pre> |
| 79 | 1 | Thiago Paiva | |
| 80 | 12 | Raphael Cóbe | * br-int: integration bridge, nome padrão e fixo. |
| 81 | 1 | Thiago Paiva | |
| 82 | 1 | Thiago Paiva | |
| 83 | 12 | Raphael Cóbe | h2. Netron Command Line Application |
| 84 | 1 | Thiago Paiva | |
| 85 | 1 | Thiago Paiva | Requer: python-pyparsing, python-cliff, python-quantumclient |
| 86 | 1 | Thiago Paiva | |
| 87 | 1 | Thiago Paiva | |
| 88 | 15 | Raphael Cóbe | h2. OpenStack Compute |
| 89 | 1 | Thiago Paiva | |
| 90 | 12 | Raphael Cóbe | Interagem com Netron através da API. Comunica com Netron API para connectar cada vNIC da VM em uma rede em particular. |
| 91 | 1 | Thiago Paiva | |
| 92 | 1 | Thiago Paiva | h2. Neutron Client |
| 93 | 1 | Thiago Paiva | |
| 94 | 1 | Thiago Paiva | agent-* |
| 95 | 1 | Thiago Paiva | |
| 96 | 1 | Thiago Paiva | dhcp-agent-* |
| 97 | 1 | Thiago Paiva | |
| 98 | 1 | Thiago Paiva | ext-* (extensões) |
| 99 | 1 | Thiago Paiva | |
| 100 | 1 | Thiago Paiva | floatingip-* |
| 101 | 1 | Thiago Paiva | |
| 102 | 1 | Thiago Paiva | l3-agent-* |
| 103 | 1 | Thiago Paiva | |
| 104 | 1 | Thiago Paiva | lb-* (loading balance) |
| 105 | 1 | Thiago Paiva | lb-pool-* |
| 106 | 1 | Thiago Paiva | lb-healthmonitor-* |
| 107 | 1 | Thiago Paiva | lb-member-* |
| 108 | 1 | Thiago Paiva | lb-vip-* |
| 109 | 1 | Thiago Paiva | |
| 110 | 1 | Thiago Paiva | net-* |
| 111 | 1 | Thiago Paiva | |
| 112 | 1 | Thiago Paiva | queue-* |
| 113 | 1 | Thiago Paiva | |
| 114 | 1 | Thiago Paiva | router-* |
| 115 | 1 | Thiago Paiva | |
| 116 | 1 | Thiago Paiva | security-* |
| 117 | 1 | Thiago Paiva | |
| 118 | 1 | Thiago Paiva | subnet-* |
| 119 | 1 | Thiago Paiva | |
| 120 | 1 | Thiago Paiva | quota-* |
| 121 | 1 | Thiago Paiva | |
| 122 | 1 | Thiago Paiva | security-group-* |
| 123 | 1 | Thiago Paiva | |
| 124 | 12 | Raphael Cóbe | h2. Exemplos - Netron API |
| 125 | 15 | Raphael Cóbe | <pre> |
| 126 | 1 | Thiago Paiva | $ quantum net-create net1 |
| 127 | 1 | Thiago Paiva | $ quantum net-create net2 --provider:network_type local |
| 128 | 1 | Thiago Paiva | $ quantum net-create --tenant-id=<id> net1 |
| 129 | 1 | Thiago Paiva | |
| 130 | 1 | Thiago Paiva | $ quantum subnet-create net1 192.168.0.2/22 --name subnet1 |
| 131 | 1 | Thiago Paiva | |
| 132 | 1 | Thiago Paiva | $ quantum port-create net1 --fixed-ip ip_addr=192.168.2.40 |
| 133 | 1 | Thiago Paiva | $ quantum port-create net1 |
| 134 | 1 | Thiago Paiva | $ quantum port-list --fixed-ips |
| 135 | 1 | Thiago Paiva | $ quantum port-list --tenant-id=<tenant id> |
| 136 | 1 | Thiago Paiva | $ quantum port-list --device-id=<vm id> |
| 137 | 1 | Thiago Paiva | |
| 138 | 15 | Raphael Cóbe | </pre> |
| 139 | 15 | Raphael Cóbe | |
| 140 | 1 | Thiago Paiva | * as redes já devem estar criadas para serem adicionadas na instanciação das VMs |
| 141 | 15 | Raphael Cóbe | <pre> |
| 142 | 1 | Thiago Paiva | $ nova boot --image=<img id> --flavor=<fl id> --nic net_id=<net id> <vm name> |
| 143 | 15 | Raphael Cóbe | </pre> |
| 144 | 1 | Thiago Paiva | * para ip fixo (port deve ser criado antes da instanciação) |
| 145 | 15 | Raphael Cóbe | <pre> |
| 146 | 1 | Thiago Paiva | $ nova boot --image=<img id> --flavor=<fl id> --nic port_id=<net id> <vm name> |
| 147 | 15 | Raphael Cóbe | </pre> |
| 148 | 1 | Thiago Paiva | |
| 149 | 12 | Raphael Cóbe | h2. Físico -> Virtual |
| 150 | 1 | Thiago Paiva | |
| 151 | 1 | Thiago Paiva | 1) eth0 (VM) |
| 152 | 1 | Thiago Paiva | 2) TAP VNET0 (hypervisor network interface card, VIF, vNIC) |
| 153 | 7 | Thiago Paiva | 3) LINUX BRIDGE qbrXXX (hub, multi NIC, virtual ou físico) |
| 154 | 1 | Thiago Paiva | 4) veth pair {qcbXXX, qvoXXX} (entra de um lado e sai do outro) |
| 155 | 1 | Thiago Paiva | 5) open switch bridge br-int (virtual switch, integration bridge,todos as VM estão conectadas a ele) |
| 156 | 1 | Thiago Paiva | 6) veth pair (int-br-eth1, phy-br-eth1) |
| 157 | 1 | Thiago Paiva | 7) physical network interface card eth1 |
| 158 | 1 | Thiago Paiva | |
| 159 | 12 | Raphael Cóbe | h2. Ryu |
| 160 | 15 | Raphael Cóbe | <pre> |
| 161 | 1 | Thiago Paiva | $ sudo pip install ryu |
| 162 | 7 | Thiago Paiva | $ sudo apt-get install quantum-plugin-ryu-agent openvswitch-switch python-openvswitch openvswitch-datapath-dkms |
| 163 | 15 | Raphael Cóbe | </pre> |
| 164 | 7 | Thiago Paiva | * ovs_ryu_plugin.ini e quantum.conf devem ser copiados em cada nó que tenha agente ryu |
| 165 | 1 | Thiago Paiva | |
| 166 | 1 | Thiago Paiva | |
| 167 | 12 | Raphael Cóbe | h2. Not to do |
| 168 | 1 | Thiago Paiva | |
| 169 | 7 | Thiago Paiva | * Proxies ainda não implementados então não se deve executar: |
| 170 | 1 | Thiago Paiva | ** nova-manage |
| 171 | 1 | Thiago Paiva | ** nova para administrar recursos de rede |