设为首页 收藏本站
查看: 891|回复: 0

[经验分享] Create Windows7 VM on OpenStack Havana (CentOS 6.5)

[复制链接]

尚未签到

发表于 2017-6-27 08:49:38 | 显示全部楼层 |阅读模式
  2015年3月15日发布
  Reference: http://cloud-ninja.org/2014/05/14/running-windows-7-guests-on-openstack-icehouse/
  Contents:

  • Requirements
  • Install OpenStack(Havana) Compute node
  • Create Windows 7 image for OpenStack
  • Deploy VM on OpenStack
  • Issue on assigning GPUs to VM which is on OpenStack
  1. Requirements

  • A windows 7 images download link
  • VirtIO driver for KVM guest windows download link (Here I used virtio-win-0.1.74 version, latest version may not work with Havana version)
  • Cloudbase-init download link
  • CentOS 6.5 Linux Machine with kernel 2.6.x (with 3.x version, havana does not work well)

  2. Install OpenStack(Havana) Compute node


  2.1 Basic OS Configuration


  service NetworkManager stop

  service network start

  chkconfig NetworkManager off

  chkconfig network on


  vi /etc/hosts

  127.0.0.1 localhost

  xxx.xxx.x.x controller

  xxx.xxx.x.x compute1


  Install the ntp package on each system running OpenStack services.

  yum install ntp

  service ntpd start

  chkconfig ntpd on


  yum install http://repos.fedorapeople.org/repos/openstack/openstack-havana/rdo-release-havana-7.noarch.rpm

  yum install openstack-utils

  yum install openstack-selinux

  yum upgrade

  reboot (kernel version is 2.6.32-504.8.1.el6.x86_64)


  2.2 Network is configured with Neutron Network
  Before following process, make sure that turn off all firewall and then restart
  service iptables stop
  service iptables start
  (OpenStack 설치 시 방화벽 자동 설정해줌. 아니면 compute service가 실행되지 않음)
  Disable packet destination filtering
  vi /etc/sysctl.conf
  net.ipv4.conf.all.rp_filter=0
  net.ipv4.conf.default.rp_filter=0
  sysctl -p
  
Install and Neutron Plug-ins on a dedicated compute node
  
Install Open vSwitch plug-in
  ------------------------------------------------------------
  yum install openstack-neutron-openvswitch
  service openvswitch start
  chkconfig openvswitch on
  ovs-vsctl add-br br-int
  vi /etc/neutron/neutron.conf
  core-plugin=neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2
  api_paste_config=/etc/neutron/api-paste.ini
  rpc_backend=neutron.openstack.common.rpc.impl_qpid
  vi /etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini
  [securitygroup]
  firewall_driver=neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
  chkconfig neutron-openvswitch-agent on
  
For GRE tunneling
  vi /etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini
  [ovs]
  tenant_network_type=gre
  tunnel_id_ranges=1:1000
  enable_tunneling=True
  integration_bridge=br-int
  tunnel_bridge=br-tun
  local_ip=DATA_INTERNET_IP
  
For VLANs
  vi /etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini
  [ovs]
tenant_network_type = vlan
network_vlan_ranges = physnet1:1:4094
bridge_mappings = physnet1:br-DATA_INTERFACE
  Create the bridge for DATA_INTERFACE and add DATA_INTERFACE to it:
  ovs-vsctl add-br br-DATA_InTERFACE
  ovs-vsctl add-port br-DATA_INTERFACE DATA_INTERFACE
  -------------------------------------------------------------
  Install and Configure Neutron Network
  vi /etc/neutron/neutron.conf
  auth_host = controller
admin_tenant_name = service
admin_user = neutron
admin_password = NEUTRON_PASS
auth_url = http://controller:35357/v2.0
auth_strategy = keystone
rpc_backend = neutron.openstack.common.rpc.impl_qpid
qpid_hostname = controller
  vi /etc/neutron/neutron.conf

  [agent]
  ...
root_helper = sudo neutron-rootwrap /etc/neutron/rootwrap.conf
  [database]connection = mysql://neutron: NEUTRON_DBPASS@controller/neutron
  vi /etc/neutron/api-paste.ini

  [filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
auth_host = controller
admin_tenant_name = service
admin_user = neutron
admin_password = NEUTRON_PASS

  vi /etc/nova/nova.conf
  network_api_class=nova.network.neutronv2.api.API
  neutron_url=http://controller:9696
  neutron_auth_strategy=keystone
  neutron_admin_tenant_name=service
  neutron_admin_username=neutron
  neutron_admin_password=NEUTRON_PASS
  neutron_admin_auth_url=http://controller:35357/v2.0
  linuxnet_interface_driver = nova.network.linux_net.LinuxOVSInterfaceDriver
  firewall_driver=nova.virt.firewall.NoopFirewallDriver
  security_group_api=neutron
  service openstack-nova-compute restart
  service neutron-openvswitch-agent restart
  
3. Create Windows7 image for OpenStack
  virt-manager
  New VM -> Name: vm_windows& -> Choose "Local install media(ISO image or CDROM)"


  Use ISI image:
/root/openstack-images/X17-24329.iso
OS type:
Windows 7

  
Memory 2048MB
  CPUs 2


  Select managed or other existing storage ( This is for adding virtual CD of installing VirtIO Driver)
  New volume Name: vm_windows7.img
  Format: qcow2
  Max Capacity: 20000MB(20GB)
  Allocation: 20000MB(20GB)


  




  Forward
  click customize configuration before install (This is for adding new hardware)
  Finish
  Add Hardware


  
  select managed or other existing storage
  Browse: /root/openstack-images/virtio-win-0.1-74.iso
  Device type: IDE cdrom

  
Switch the network and disk to use virtio as shown
  



  Click Begin Installation

  

Click “Load drivers” and browse to E:\WIN7\AMD64:
  Click “OK” and select the “Red Hat VirtIO SCSI controller”. Your 20 GB partition should now appear. Click next, and go grab some coffee while Windows does its thing.
  Open the windows device manager.
  Right click the ethernet controller and navigate to the drivers in E:\WIN7\AMD64\. It should auto-detect your device after hitting ok.
  Repeat this process for the other two broken devices. Finally verify the system can reach the Internet. If everything looks okay, then shutdown the guest OS and open the info panel:
  Remove both cdroms, and restart the Windows guest.
  
Install Cloudbase-init
  
http://www.cloudbase.it/cloud-init-for-windows-instances/
  For now, accept the defaults and continue the install. When everything finishes don’t let the installer run sysprep. Also, before you shutdown, edit the C:\Program Files (x86)\Cloudbase Solutions\Cloudbase-Init\conf and make it look something like this:
  

  [DEFAULT]

  username=Admin

  groups=Administrators

  inject_user_password=true

  plugins=cloudbaseinit.plugins.windows.sethostname.SetHostNamePlugin,cloudbaseinit.plugins.windows.createuser.CreateUserPlugin,cloudbaseinit.plugins.windows.networkconfig.NetworkConfigPlugin,cloudbaseinit.plugins.windows.sshpublickeys.SetUserSSHPublicKeysPlugin,cloudbaseinit.plugins.windows.extendvolumes.ExtendVolumesPlugin,cloudbaseinit.plugins.windows.userdata.UserDataPlugin

  network_adapter=

  config_drive_raw_hhd=true

  config_drive_cdrom=true

  bsdtarpath=C:Program Files (x86)Cloudbase SolutionsCloudbase-Initbinbsdtar.exe

  verbose=true

  logdir=C:Program Files (x86)Cloudbase SolutionsCloudbase-Initlog

  logfile=cloudbase-init.log
  
Now disable the Windows firewall:
  All the connections to this server will be controlled the security groups in OpenStack. Also, we should allow RDP access:

  



  Now we can shutdown, by manually running sysprep again:

  C:\Windows\System32\sysprep\sysprep.exe /generalize /oobe /shutdown
  4. Deploy VM on OpenStack
  
image convert
  qemu-img convert -c -f raw -O qcow2 /var/lib/libvirt/images/win7.img ./win7.qcow2
  
upload image on OpenStack
  glance image-create --name="Windows 7 (x86_64)" --is-public=True --container-format=bare --disk-format=qcow2 --file=./win7.qcow2
  deploy instance
  nava boot --flavor flavor name --image imageID --nicnet-id=netID --availability-zonenova:hostname vmName
  http://xxx.xx.xx.x/dashbaord/
  

  


  5. Issue on assigning GPUs to VM which is on OpenStack
  Kernel compile to 3.17.2 version and modify kernel options.
  See this article: http://heavenkong.blogspot.kr/2015/01/gpu-pass-through-on-kvm-with-windows-7.html

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-388503-1-1.html 上篇帖子: openstack学习笔记一 虚拟机启动过程代码跟踪 下篇帖子: 连接 insance 到 vlan101
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表