[OpenStack] OpenStack Essex - Nova 安装部署与命令行详解

本文详细介绍如何在Ubuntu系统上安装并配置OpenStack的Nova组件,包括安装必要软件包、编辑配置文件、创建物理卷及卷组、设置环境变量、重启服务等步骤,确保虚拟机实例管理服务正常运行。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

 Nova

Install nova using the following commands:

sudo apt-get install nova-api nova-cert nova-compute nova-compute-kvm nova-doc nova-network nova-objectstore nova-scheduler nova-volume rabbitmq-server novnc nova-consoleauth
 Nova Configuration

Edit the /etc/nova/nova.conf file to look like this.

--dhcpbridge_flagfile=/etc/nova/nova.conf
--dhcpbridge=/usr/bin/nova-dhcpbridge
--logdir=/var/log/nova
--state_path=/var/lib/nova
--lock_path=/run/lock/nova
--allow_admin_api=true
--use_deprecated_auth=false
--auth_strategy=keystone
--scheduler_driver=nova.scheduler.simple.SimpleScheduler
--s3_host=10.10.10.2
--ec2_host=10.10.10.2
--rabbit_host=10.10.10.2
--cc_host=10.10.10.2
--nova_url=http://10.10.10.2:8774/v1.1/
--routing_source_ip=10.10.10.2
--glance_api_servers=10.10.10.2:9292
--image_service=nova.image.glance.GlanceImageService
--iscsi_ip_prefix=192.168.4
--sql_connection=mysql://novadbadmin:novasecret@10.10.10.2/nova
--ec2_url=http://10.10.10.2:8773/services/Cloud
--keystone_ec2_url=http://10.10.10.2:5000/v2.0/ec2tokens
--api_paste_config=/etc/nova/api-paste.ini
--libvirt_type=kvm
--libvirt_use_virtio_for_bridges=true
--start_guests_on_host_boot=true
--resume_guests_state_on_host_boot=true
# vnc specific configuration
--novnc_enabled=true
--novncproxy_base_url=http://10.10.10.2:6080/vnc_auto.html
--vncserver_proxyclient_address=10.10.10.2
--vncserver_listen=10.10.10.2
# network specific settings
--network_manager=nova.network.manager.FlatDHCPManager
--public_interface=eth0
--flat_interface=eth1
--flat_network_bridge=br100
--fixed_range=192.168.4.1/27
--floating_range=10.10.10.2/27
--network_size=32
--flat_network_dhcp_start=192.168.4.33
--flat_injected=False
--force_dhcp_release
--iscsi_helper=tgtadm
--connection_type=libvirt
--root_helper=sudo nova-rootwrap
--verbose

Create a Physical Volume.

sudo pvcreate /dev/sda6

Create a Volume Group named nova-volumes.

sudo vgcreate nova-volumes /dev/sda6

Change the ownership of the /etc/nova folder and permissions for /etc/nova/nova.conf:

sudo chown -R nova:nova /etc/nova
sudo chmod 644 /etc/nova/nova.conf

Open /etc/nova/api-paste.ini and at the end of the file, edit the following lines:

admin_tenant_name = %SERVICE_TENANT_NAME%
admin_user = %SERVICE_USER%
admin_password = %SERVICE_PASSWORD%

These values have to be modified conforming to configurations made earlier. The admin_tenant_name will be 'service', admin_user will be 'nova' and admin_password is 'nova'.

After editing, the lines should be as follows:

admin_tenant_name = service
admin_user = nova
admin_password = nova

Create nova schema in the MySQL database.

sudo nova-manage db sync

Provide a range of IPs to be associated to the instances.

sudo nova-manage network create private --fixed_range_v4=192.168.4.32/27 --num_networks=1 --bridge=br100 --bridge_interface=eth1 --network_size=32 

Export the following environment variables.

export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=admin
export OS_AUTH_URL="http://localhost:5000/v2.0/"

Restart nova services.

sudo restart libvirt-bin; sudo restart nova-network; sudo restart nova-compute; sudo restart nova-api; sudo restart nova-objectstore; sudo restart nova-scheduler; sudo restart nova-volume; sudo restart nova-consoleauth;

To test if nova is setup correctly run the following command.

sudo nova-manage service list
Binary           Host              Zone             Status     State Updated_At
nova-network     server1           nova             enabled    :-)   2012-04-20 08:58:43
nova-scheduler   server1           nova             enabled    :-)   2012-04-20 08:58:44
nova-volume      server1           nova             enabled    :-)   2012-04-20 08:58:44
nova-compute     server1           nova             enabled    :-)   2012-04-20 08:58:45
nova-cert        server1           nova             enabled    :-)   2012-04-20 08:58:43

If the output is similar to the above with all components happy, your setup is ready to be used.

 

 

转载于:https://www.cnblogs.com/licheng/archive/2012/06/04/2535093.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值