Merge "Update docs to portgroup with creating windows images"

This commit is contained in:
Zuul 2018-09-27 22:12:56 +00:00 committed by Gerrit Code Review
commit 92114bb9ff
4 changed files with 147 additions and 0 deletions

View File

@ -0,0 +1,91 @@
.. _building_image_windows:
Building images for Windows
---------------------------
We can use ``New-WindowsOnlineImage`` in `windows-openstack-imaging-tools`_
tool as an option to create Windows images (whole disk images) corresponding
boot modes which will support for Windows NIC Teaming. And allow the
utilization of link aggregation when the instance is spawned on hardware
servers (Bare metals).
Requirements:
~~~~~~~~~~~~~
* A Microsoft Windows Server Operating System along with
``Hyper-V virtualization`` enabled,
``PowerShell`` version >=4 supported,
``Windows Assessment and Deployment Kit``,
in short ``Windows ADK``.
* The windows Server compatible drivers.
* Working git environment.
Preparation:
~~~~~~~~~~~~
* Download a Windows Server 2012R2/ 2016 installation ISO.
* Install Windows Server 2012R2/ 2016 OS on workstation PC along with
following feature:
- Enable Hyper-V virtualization.
- Install PowerShell 4.0.
- Install Git environment & import git proxy (if have).
- Create new ``Path`` in Microsoft Windows Server Operating System which
support for submodule update via ``git submodule update init`` command::
- Variable name: Path
- Variable value: C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Git\bin
- Rename virtual switch name in Windows Server 2012R2/ 2016 in
``Virtual Switch Manager`` into `external`.
Implementation:
~~~~~~~~~~~~~~~
* ``Step 1``: Create folders: ``C:\<folder_name_1>`` where output images will
be located, ``C:\<folder_name_2>`` where you need to place the necessary
hardware drivers.
* ``Step 2``: Copy and extract necessary hardware drivers in
``C:\<folder_name_2>``.
* ``Step 3``: Insert or burn Windows Server 2016 ISO to ``D:\``.
* ``Step 4``: Download ``windows-openstack-imaging-tools`` tools.
.. code-block:: console
git clone https://github.com/cloudbase/windows-openstack-imaging-tools.git
* ``Step 5``: Create & running script `create-windows-cloud-image.ps1`:
.. code-block:: console
git submodule update --init
Import-Module WinImageBuilder.psm1
$windowsImagePath = "C:\<folder_name_1>\<output_file_name>.qcow2"
$VirtIOISOPath = "C:\<folder_name_1>\virtio.iso"
$virtIODownloadLink = "https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-0.1.133-2/virtio-win.iso"
(New-Object System.Net.WebClient).DownloadFile($virtIODownloadLink, $VirtIOISOPath)
$wimFilePath = "D:\sources\install.wim"
$extraDriversPath = "C:\<folder_name_2>\"
$image = (Get-WimFileImagesInfo -WimFilePath $wimFilePath)[1]
$switchName = 'external'
New-WindowsOnlineImage -WimFilePath $wimFilePath
-ImageName $image.ImageName ` -WindowsImagePath $windowsImagePath -Type 'KVM' -ExtraFeatures @() `
-SizeBytes 20GB -CpuCores 2 -Memory 2GB -SwitchName $switchName ` -ProductKey $productKey -DiskLayout 'BIOS' `
-ExtraDriversPath $extraDriversPath ` -InstallUpdates:$false -AdministratorPassword 'Pa$$w0rd' `
-PurgeUpdates:$true -DisableSwap:$true
After executing this command you will get two output files, first one being
"C:\<folder_name_1>\<output_file_name>.qcow2", which is the resulting windows
whole disk image and "C:\<folder_name_1>\virtio.iso", which is virtio iso
contains all the synthetic drivers for the KVM hypervisor.
See `example_windows_images`_ for more details and examples.
.. note::
We can change ``SizeBytes``, ``CpuCores`` and ``Memory`` depending on requirements.
.. _`example_windows_images`: https://github.com/cloudbase/windows-openstack-imaging-tools/blob/master/Examples
.. _`windows-openstack-imaging-tools`: https://github.com/cloudbase/windows-openstack-imaging-tools

View File

@ -29,6 +29,7 @@ the services.
Conductor Groups <conductor-groups>
Upgrade Guide <upgrade-guide>
Security <security>
Windows Images <building-windows-images>
Troubleshooting FAQ <troubleshooting>
Dashboard Integration

View File

@ -117,3 +117,18 @@ group, in no particular order. It starts with 0 and increments by 1 for every
configured port group.
.. _`kernel documentation on bonding`: https://www.kernel.org/doc/Documentation/networking/bonding.txt
Link aggregation/teaming on windows
-----------------------------------
Portgroups are supported for Windows Server images, which can created by
:ref:`building_image_windows` instruction.
You can customise an instance after it is launched along with
`script file <../../../../tools/link_aggregation_on_windows.ps1>`_ in
``Configuration`` of ``Instance`` and selected ``Configuration Drive`` option.
Then ironic virt driver will generate network metadata and add all the
additional information, such as bond mode, transmit hash policy,
MII link monitoring interval, and of which links the bond consists.
The information in InstanceMetadata will be used afterwards to generate
the config drive.

View File

@ -0,0 +1,40 @@
#ps1_sysnative
# Copyright 2018 FUJITSU LIMITED
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# Load network_data.json
$dir_data_config_file = (Get-ChildItem -Path ($PSCommandPath | Split-Path -Parent) -Filter 'network_data.json' -File -Recurse).fullname
$network_data = Get-Content -Raw -Path $dir_data_config_file | ConvertFrom-Json
# Create NIC Teaming base on netwok_data.json
$MAC_MASTER=''
foreach ($nic in $network_data.links)
{
if ($nic.type -like 'bond')
{
$nic_master=Get-NetAdapter | where MacAddress -eq $nic.ethernet_mac_address.Replace(':','-').ToUpper()
$MAC_MASTER = $nic.ethernet_mac_address.Replace(':','-').ToUpper()
New-NetLbfoTeam -Name 'openstack' -TeamMembers $nic_master.Name -TeamingMode SwitchIndependent -LoadBalancingAlgorithm MacAddresses -Confirm:$false
}
if ($nic.type -like 'phy')
{
$MAC_MEMBER = $nic.ethernet_mac_address.Replace(':','-').ToUpper()
if($MAC_MEMBER -notlike $MAC_MASTER)
{
$nic_member=Get-NetAdapter | where MacAddress -eq $MAC_MEMBER
Add-NetLbfoTeamMember -Name $nic_member.Name -Team 'openstack' -Confirm:$false
}
}
}