[英]openstack installation single node
I am trying a single node installation of openstack. 我正在尝试单节点安装openstack。 I have a HP blade , over which ubuntu server 14.04 is installed. 我有一个HP刀片服务器,通过该刀片服务器安装了ubuntu服务器14.04。 i have created an open virtual switch and a virtual port.i follwed the below link to set up KVM . 我已经创建了一个开放的虚拟交换机和一个虚拟端口。我按照下面的链接来设置KVM。 https://help.ubuntu.com/lts/serverguide/libvirt.html . https://help.ubuntu.com/lts/serverguide/libvirt.html 。 I have to create another VM on the KVM for the controller which has to have the ubuntu server as well. 我必须在KVM上为必须具有ubuntu服务器的控制器创建另一个VM。 I have mounted the iso file on to a folder currently. 我已经将iso文件安装到当前文件夹中。 I am stuck after this point. 在这之后,我陷入了困境。 i need direction on how to create a VM over this KVM and load the ubuntu server over it. 我需要有关如何在此KVM上创建VM并在其上加载ubuntu服务器的指导。 Any help would be greatly appriciated 任何帮助将不胜感激
Here is the list of step to create KVM machine with OVS. 这是使用OVS创建KVM计算机的步骤列表。
Installing KVM 安装KVM
Check if KVM is supported on the Machine. 检查机器上是否支持KVM。
egrep -c '(vmx|svm)' /proc/cpuinfo egrep -c'(vmx | svm)'/ proc / cpuinfo
output: should return greater than 0 if KVM is supported. 输出:如果支持KVM,则应返回大于0的值。
Check the if 64bit Kernel 检查是否64位内核
egrep -c ' lm ' /proc/cpuinfo egrep -c'lm'/ proc / cpuinfo
output: should return greater than 0 if its 64bit Kernel 输出:如果其64位内核,则应返回大于0的值
Install KVM and related dependencies 安装KVM和相关的依赖项
sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder virtinst bridge-utils uml-utilities
Add current user to libvert 将当前用户添加到libvert
sudo adduser $USER libvirtd
Verify if installation was sucessful 验证安装是否成功
virsh -c qemu:///system list
output:Should return empty list and not any error. 输出:应该返回空列表,没有任何错误。
Default configuration locations 默认配置位置
/var/lib/libvirt/
默认目录: /var/lib/libvirt/
/var/lib/libvirt/boot/
用于安装的ISO映像: /var/lib/libvirt/boot/
/var/lib/libvirt/images/
VM安装目录: /var/lib/libvirt/images/
/etc/libvirt/
LVM / LXC / qemu的Libvirt配置目录: /etc/libvirt/
By default 'default' network would be created by libvirt, check if its present. 默认情况下,“默认”网络将由libvirt创建,请检查其是否存在。
sudo virsh net-list
To view the network info. 查看网络信息。
sudo virsh net-info default or sudo virsh net-dumpxml default
By default VNC runs on localhost, change the configuration such that it could be remotely accessed. 默认情况下,VNC在本地主机上运行,更改配置以使其可以被远程访问。
Edit /etc/libvirt/qemu.conf 编辑/etc/libvirt/qemu.conf
vnc_listen = "0.0.0.0"
This will enable connections from all hosts, 这将启用来自所有主机的连接,
Edit /etc/libvirt/libvirtd.conf 编辑/etc/libvirt/libvirtd.conf
listen_tcp = 1
Check if the ports used by vnc and libvirt are open. 检查vnc和libvirt使用的端口是否打开。 In the case you are using firewall: 如果您使用的是防火墙:
sudo ufw status verbose
Reboot system 重启系统
Create a VM 创建一个虚拟机
sudo virt-install \\ --name kp-devstack \\ --ram 1524 \\ --vcpus=4 \\ --os-variant=linux \\ --virt-type kvm \\ --cdrom=ubuntu-16.04-server-amd64.iso \\ --network network=default,model=virtio \\ --graphics vnc \\ --disk path=/home/kprasad/images/ububtu64.img,size=25,bus=virtio
Set RAM greater than 2GB provided VM is 64bit 如果VM为64位,则设置RAM大于2GB
Set virt-type to kvm if kvm is supported else qemu other option is xen. 如果支持kvm,则将virt-type设置为kvm,否则qemu其他选项是xen。
you can set network to default or to tap shown in later part to use ovs 您可以将网络设置为默认值,或者点击后面部分显示的以使用ovs
Installation of GuestVM. GuestVM的安装。
Check vnc ip and port 检查vnc ip和端口
sudo virsh dumpxml kp-devstack | grep vnc
Connect to VNC server 连接到VNC服务器
a. 一种。 if your ubuntu machine has gui you can use vnc client 如果您的ubuntu计算机具有gui,则可以使用vnc客户端
b. b。 if you want to connect to vnc server from windows you can use real vnc 如果要从Windows连接到vnc服务器,则可以使用真正的vnc
c. C。 In Server textbox give the ip address of the ubuntu machine one which vm is installed in following format 在“服务器”文本框中,以以下格式提供ubuntu机器的ip地址,其中安装了vm。
<ip-address:<port>
On click of 'OK' a window shall open. 单击“确定”后,将打开一个窗口。
Installation and setting up of Openvswitch 安装和设置Openvswitch
Install dependencies 安装依赖
sudo apt-get install openvswitch-common openvswitch-pki openvswitch-dbg openvswitch-switch openvswitch-ipsec openvswitch-switch-dpdk openvswitch-vtep openvswitch-switch
Generally two or more nics are assigned in cloud environment, in most cases there shall be atleast 2 nics one for management and other for data network. 通常在云环境中会分配两个或多个网卡,在大多数情况下,至少应有两个网卡用于管理,而另一个网卡用于数据网络。 Assuming eth0 for management network and eth1 for datanetwork. 假设管理网络为eth0,数据网络为eth1。
Edit /etc/network/interfaces file set eth1 iface load to manual 编辑/ etc / network / interfaces文件,将eth1 iface加载设置为手动
auto eth1
iface eth1 inet manual
Create Bridge 创建桥
sudo ovs-vsctl add-br br0
Add eth1 interface to bridge 将eth1接口添加到网桥
sudo ovs-vsctl add-port br0 eth1
Creation of Openvswitch network for libvirt 为libvirt创建Openvswitch网络
Create a xml file to be loaded to libvirt 创建一个要加载到libvirt的xml文件
<network> <name>ovs-net</name> <forward mode='bridge'/> <bridge name='br0'/> <virtualport type='openvswitch' /> </network>
Create Network using the xml 使用xml创建网络
sudo virsh net-create kp-ovs.xml
Check if network is sucessfully created 检查网络是否成功创建
sudo virsh net-dumpxml ovs-net
Creating a NIC and attaching to VM 创建网卡并连接到虚拟机
List Interfaces attached to VM 列出连接到VM的接口
sudo virsh domiflist kp-devstack
Attach the nic with OVS network 将NIC连接到OVS网络
sudo virsh attach-interface --domain kp-devstack --type network --source ovs-net --model virtio --config --live
Verify nic is created 验证网卡已创建
sudo virsh domiflist kp-devstack
The second nic created also should be visible in openvswitch 创建的第二个nic也应该在openvswitch中可见
sudo ovs-vsctl show
ssh virtual machine ssh虚拟机
Check if the second nic is added 检查是否添加了第二个网卡
sudo ifconfig -a
if the nic is added sucessfully, bring it up 如果网卡添加成功,请调高
sudo ifconfig eth1 up
8 Assign ip address using dhcp 8使用dhcp分配IP地址
sudo ifconfig eth1 0
sudo dhclient eth1
Deleting VM 删除虚拟机
virsh list --all
virsh destroy kp-devstack
virsh undefine kp-devstack
virsh vol-list --pool
virsh vol-delete --pool images ububtu64.img
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.