跳转到: 导航, 搜索

HypervInstall

Hyper-v 开发

准备 Windows

配置 Windows

  • 支持的操作系统:Windows 2008 R2 Datacenter/Enterprise(Enterprise 许可有限制)
  • 初始配置任务 -> 添加角色 -> Hyper-v
  • 初始配置任务 -> 添加功能 -> 远程服务器管理工具,.Net Framework 3.5.1

安装依赖

请注意,Windows 2008 只能运行计算管理器,不能运行其他任何组件。


python 2.6 (32 bit): (https://pythonlang.cn/download/releases/2.6.6/)
Microsoft Visual C++ 2008 Redistributable Package: (http://www.microsoft.com/downloads/en/details.aspx?familyid=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF&displaylang=en)
easy_install: (http://pypi.python.org/pypi/setuptools#files)
pywin32==214 (http://sourceforge.net/projects/pywin32/files/pywin32/Build%20214/pywin32-214.win32-py2.6.exe/download)
Swig=2.0.1 (http://sourceforge.net/projects/swig/)
M2Crypto==0.19.1 (http://chandlerproject.org/pub/Projects/MeTooCrypto/M2Crypto-0.19.1.win32-py2.6.exe)
MySQL-python==1.2.2 (http://www.codegood.com/archives/4)
MinGW (http://www.mingw.org/ easiest way to install is to use mingw-get-inst)

Use easy_install to install the following: (If they error, you can download the package directly from http://pypi.python.org/pypi) (Some of these may not be available automatically and will need to be tracked down at their current source)
pip
amqplib==0.6.1
anyjson==0.3.1
argparse==1.2.1
boto==1.9b
carrot==0.10.7
eventlet==0.9.16
glance==2011.3~d4
greenlet==0.3.1
httplib2==0.7.1
IPy==0.72
lockfile==0.9.1
Markdown==2.0.3
mox==0.5.3
MySQL-python==1.2.2
netaddr==0.7.5
paramiko==1.7.7.1
Paste==1.7.5.1
PasteDeploy==1.5.0
pip==1.0.1
prettytable==0.5
pyasn1==0.0.13b
pycrypto==2.3
python==novaclient==2.5.3
python_gflags==1.4
Routes==1.12.3
SQLAlchemy==0.7.1
tornado==1.2.1
Twisted==11.0.0
WebOb==1.0.8
WMI==1.4.9
zope.interface==3.6.3

设置开发分支

http://launchpad.net/bzr/2.3/2.3b3/+download/bzr-2.3b3.win32-py2.6.exe 安装 32 位 bzr


cd %HOMEPATH%
mkdir .ssh
(put your id_rsa file for private/public key ssh authentication to launchpad here)

mkdir c:\openstack
cd c:\openstack

set BZR_SSH=paramiko
bzr whoami "Your Name <first.last@doman.tld>"
bzr lp-login <LP ID>
bzr init-repo .

bzr branch lp:nova

配置 Hyper-V 上的 Nova 标志

cd nova\bin

type nova.conf

--verbose
--nodaemon
--fake_network=True
--network_manager=nova.network.manager.FlatDHCPManager
--cc_host=<cc host>
--routing_source_ip=<cc host>
--auth_driver=nova.auth.dbdriver.DbDriver
--connection_type=hyperv
--rabbit_host=<rabbit host>
--sql_connection=mysql://<user:password>@dbserver/nova
--use_s3=False
--images_path=C:\Users\Public\Documents\Hyper-V\Virtual hard disks\images
--instances_path=C:\Users\Public\Documents\Hyper-V\Virtual hard disks\instances
--glance_api_servers=<glance_host:glance_api_port>

运行 Nova

bin\nova-compute

实例管理

准备镜像

在 Hyper-V 上安装新的虚拟机以创建 VHD 文件:http://technet.microsoft.com/en-us/library/cc732470%28WS.10%29.aspx#BKMK_step3 VHD 文件通常保存在 C:\Users\Public\Documents\Hyper-V\Virtual hard disks。如果使用本地副本 (use_s3=False),请将其复制到 C:\Users\Public\Documents\Hyper-V\Virtual hard disks\images\<image name>\image(请注意,这里是 "image" 而不是 "image.vhd" 等。VHD 文件需要重命名为仅 "image" 放在镜像名称的目录中。)