diff options
36 files changed, 3063 insertions, 328 deletions
diff --git a/fuel/docs/src/installation-instructions.rst b/fuel/docs/src/installation-instructions.rst index 388907e..234dfc2 100644 --- a/fuel/docs/src/installation-instructions.rst +++ b/fuel/docs/src/installation-instructions.rst @@ -1,20 +1,20 @@ -:Authors: Jonas Bjurel (Ericsson) -:Version: 0.1 +:Authors: Jonas Bjurel (Ericsson AB) +:Version: 0.0.1 -================================================================ -OPNFV Installation instructions for - < Component denomination > -================================================================ +================================================ +OPNFV Installation instructions for - Fuel@OPNFV +================================================ Abstract ======== -This document describes how to install <Component>, it's dependencies and required system resources. +This document describes how to install Fuel@OPNFV, it's dependencies and required system resources. License ======= -<WORK'S NAME> (c) by <AUTHOR'S NAME> +Fuel@OPNFV DOCs (c) by Jonas Bjurel (Ericsson AB) -<WORK'S NAME> is licensed under a Creative Commons Attribution 4.0 Unported License. You should have received a copy of the license along with this. If not, see <http://creativecommons.org/licenses/by/4.0/>. +Fuel@OPNFV DOCs are licensed under a Creative Commons Attribution 4.0 Unported License. You should have received a copy of the license along with this. If not, see <http://creativecommons.org/licenses/by/4.0/>. **Contents** @@ -44,54 +44,51 @@ License | **Date** | **Ver.** | **Author** | **Comment** | | | | | | +--------------------+--------------------+--------------------+--------------------+ -| 2015-04-14 | 0.1.0 | Jonas Bjurel | First draft | -| | | | | -+--------------------+--------------------+--------------------+--------------------+ -| | 0.1.1 | | | -| | | | | -+--------------------+--------------------+--------------------+--------------------+ -| | 1.0 | | | -| | | | | -| | | | | +| 2015-04-15 | 0.0.1 | Jonas Bjurel | First draft | +| | | (Ericsson AB) | | +--------------------+--------------------+--------------------+--------------------+ + 2 Introduction ================ -<INTRODUCTION TO THE SCOPE AND INTENTION OF THIS DOCUMENT AS WELL AS TO THE SYSTEM TO BE INSTALLED> -<EXAMPLE>: +This document describes the supported software and hardware configurations for the Fuel@OPNFV reference platform as well as providing guidelines on how to install and configure such reference system. -This document describes the supported software and hardware configurations for the Fuel OPNFV reference platform as well as providing guidelines on how to install and -configure such reference system. - -Although the available installation options gives a high degree of freedom in how the system is set-up, with what architecture, services and features, etc., not nearly all of those permutations provides a OPNFV compliant reference architecture. Following the guidelines in this document ensures -a result that is OPNFV compliant. +Although the available installation options gives a high degree of freedom in how the system is set-up, with what architecture, services and features, etc., not nearly all of those permutations provides a OPNFV compliant reference architecture. Following the guidelines in this document ensures a result that is OPNFV R1 (Arno) compliant. The audience of this document is assumed to have good knowledge in network and Unix/Linux administration. 3 Preface =========== -<DESCRIBE NEEDED PREREQUISITES, PLANNING, ETC.> - -<EXAMPLE>: Before starting the installation of Fuel@OPNFV, some planning must preceed. First of all, the Fuel@OPNFV .iso image needs to be retrieved, the Latest stable Arno release of Fuel@OPNFV can be found here: <www.opnfv.org/abc/def> Alternatively, you may build the .iso from source by cloning the opnfv/genesis git repository: + <git clone https://<linux foundation uid>@gerrit.opnf.org/gerrit/genesis> + Check-out the Arno release: + <cd genesis; git checkout arno> + Goto the fuel directory and build the .iso + <cd fuel/build; make all> -Familiarize yourself with the Fuel 6.0.1 version by reading the following documents: -- abc <http://wiki.openstack.org/abc> -- def <http://wiki.openstack.org/def> -- ghi <http://wiki.openstack.org/ghi> +For more information on how to build, please see "OPNF Build instructions for - FUel@OPNFV <http://www.opnfv.org/xyz -Secondly, a number of deployment specific parameters must be collected, those are: +Next, familiarize yourself with the Fuel 6.0.1 version by reading the following documents: + +- Fuel planning guide <http://docs.mirantis.com/openstack/fuel/fuel-6.0/planning-guide.html#planning-guide> + +- Fuel user guide <http://docs.mirantis.com/openstack/fuel/fuel-6.0/user-guide.html#user-guide> + +- Fuel operations guide <http://docs.mirantis.com/openstack/fuel/fuel-6.0/operations.html#operations-guide> + + +A number of deployment specific parameters must be collected, those are: 1. Provider sub-net and gateway information @@ -105,49 +102,46 @@ This information will be needed for the configuration procedures provided in thi 4 Hardware requirements ========================= -<PROVIDE A LIST OF MINIMUM HARDWARE REQUIREMENTS NEEDED FOR THE INSTALL> - -<EXAMPLE>: Following minimum hardware requirements must be met for installation of Fuel@OPNFV: -+--------------------+----------------------------------------------------+ -| **HW Aspect** | **Requirement** | -| | | -+--------------------+----------------------------------------------------+ -| **# of servers** | Minimum 5 (3 for non redundant deployment) | -| | 1 Fuel deployment master (may be virtualized) | -| | 3(1) Controllers | -| | 1 Compute | -+--------------------+----------------------------------------------------+ -| **CPU** | Minimum 1 socket x86_AMD64 Ivy bridge 1.6 GHz | -| | | -+--------------------+----------------------------------------------------+ -| **RAM** | Minimum 16GB/server (Depending on VNF work load) | -| | | -+--------------------+----------------------------------------------------+ -| **Disk** | Minimum 256GB 10kRPM spinning disks | -| | | -+--------------------+----------------------------------------------------+ -| **NICs** | 2(1)x10GE Niantec for Private/Public (Redundant) | -| | | -| | 2(1)x10GE Niantec for SAN (Redundant) | -| | | -| | 2(1)x1GE for admin (PXE) and control (RabitMQ,etc) | -| | | -+--------------------+----------------------------------------------------+ ++--------------------+------------------------------------------------------+ +| **HW Aspect** | **Requirement** | +| | | ++--------------------+------------------------------------------------------+ +| **# of servers** | Minimum 5 (3 for non redundant deployment): | +| | | +| | - 1 Fuel deployment master (may be virtualized) | +| | | +| | - 3(1) Controllers | +| | | +| | - 1 Compute | ++--------------------+------------------------------------------------------+ +| **CPU** | Minimum 1 socket x86_AMD64 Ivy bridge 1.6 GHz | +| | | ++--------------------+------------------------------------------------------+ +| **RAM** | Minimum 16GB/server (Depending on VNF work load) | +| | | ++--------------------+------------------------------------------------------+ +| **Disk** | Minimum 256GB 10kRPM spinning disks | +| | | ++--------------------+------------------------------------------------------+ +| **NICs** | - 2(1)x10GE Niantec for Private/Public (Redundant) | +| | | +| | - 2(1)x10GE Niantec for SAN (Redundant) | +| | | +| | - 2(1)x1GE for admin (PXE) and control (RabitMQ,etc) | +| | | ++--------------------+------------------------------------------------------+ 5 Top of the rack (TOR) Configuration requirements ==================================================== -<DESCRIBE NEEDED NETWORK TOPOLOGY SETUP IN THE TORs> - -<EXAMPLE>: -The switching infrastructure provides connectivity for the OPNFV infra-structure operations as well as for the tenant networks (East/West) and provider connectivity (North/South bound connectivity). The switching connectivity can (but does not need to) be fully redundant, in case it and comprises a redundant 10GE switch pair for “Traffic/Payload/SAN” purposes as well as a 1GE switch pair for “infrastructure control-, management and administration” +The switching infrastructure provides connectivity for the OPNFV infra-structure operations, tenant networks (East/West) and provider connectivity (North/South bound connectivity); it als provides needed connectivity for the strage Area Network (SAN). To avoid traffic congestion, it is strongly sugested that three physcally separated networks are used, that is: 1 physical network for administration and control, one physical network for tenant private and public networks, and one physical network for SAN. The switching connectivity can (but does not need to) be fully redundant, in such case it and comprises a redundant 10GE switch pair for each of the three physcally separated networks. -The switches are **not** automatically configured from the OPNFV reference platform. All the networks involved in the OPNFV infra-structure as well as the provider networks and the private tenant VLANs needs to be manually configured. +The physical TOR switches are **not** automatically configured from the OPNFV reference platform. All the networks involved in the OPNFV infra-structure as well as the provider networks and the private tenant VLANs needs to be manually configured. -This following sections guides through required black-box switch configurations. +The following sections guides through required black-box switch configurations. 5.1 VLAN considerations and blue-print -------------------------------------- @@ -157,30 +151,205 @@ This following sections guides through required black-box switch configurations. 6 OPNFV Software installation and deployment ============================================== -<DESCRIBE THE FULL PROCEDURES FOR THE INSTALLATION OF THE OPNFV COMPONENT INSTALLATION AND DEPLOYMENT> - -<EXAMPLE>: This section describes the installation of the Fuel@OPNFV installation server (Fuel master) as well as the deployment of the full OPNFV reference platform stack across a server cluster. -Etc. 6.1 Install Fuel master ----------------------- +1. Mount the built .iso file (release/opnfv-<version>.iso) as a boot device to the fuel server. + +2. Reboot the fuel server. + + - The system now boots from the ISO image. + +3. Change the grub boot parameters + + - When the grub boot menu shows up - Press Tab to edit the kernel parameters + + - Change <showmenu=no> to <showmenu=yes>. + + - Change <netmask=255.255.255.0> to <netmask=255.255.0.0>. + + - Press [Enter]. + +4 Wait until screen Fuel setup is shown (Note: This can take up to 30 minutes). + +5. Select PXE Setup and change the following fields to appropriate values (example below): + + - Static Pool Start 10.20.0.3 + + - Static Pool End 10.20.0.254 + + - DHCP Pool Start 10.20.128.3 + + - DHCP Pool End 10.20.128.254 + +6. Select DNS & Hostname and change the following fields to appropriate values: + + - Hostname <CEE Region name>-fuel + + - Domain <Domain Name> + + - Search Domain <Search Domain Name> + + - Hostname to test DNS <Hostname to test DNS> + +7. Select Time Sync and change the following fields to appropriate values: + + - NTP Server 1 <Customer NTP server 1> + + - NTP Server 2 <Customer NTP server 2> + + - NTP Server 3<Customer NTP server 3> + + **Note: This step is only to pass the network sanity test, the actual ntp parameters will be set with the pre-deploy script.** + +8. Start the installation. + + - Select Quit Setup and press Save and Quit. + + - Installation starts, wait until a screen with logon credentials is shown. + + Note: This will take about 15 minutes. 6.2 Create an OPNV (Fuel Environment) ------------------------------------- +9. Connect to Fuel with a browser towards port 8000 + +10. Create and name a new OpenStack environment, to be installed. + +11. Select <Juno on Ubuntu> or <Juno on CentOS> as per your which in the "OpenStack Release" field. + +12. Select deployment mode. + + - Select the Multi-node with HA. + +13. Select compute node mode. + + - Select KVM as hypervisor (unless you're not deploying bare metal or nested KVM/ESXI). + +14. Select network mode. + + - Select Neutron with VLAN segmentation + + ** Note: This will later be overridden to VXLAN by OpenDaylight.** + +15. Select Storage Backends. + + - Select Ceph for Cinder and default for glance. + +16. Select additional services. + + - Check option <Install Celiometer (OpenStack Telemetry)>. + +17. Create the new environment. + 6.3 Configure the OPNFV environment ----------------------------------- +18. Enable PXE booting + + - For every controller- and compute server: enable PXE Booting as the first boot device in the BIOS boot order menu, and hard disk as the second boot device in the same menu. + +19. Reboot all the controller- and compute blades. + +20. Wait for the availability of nodes showing up in the Fuel GUI. + + - Wait until all nodes are displayed in top right corner of the Fuel GUI: <total number of server> TOTAL NODES and <total number of servers> UNALLOCATED NODES. + +21. Open the environment you previously created. + +22. Open the networks tab. + +23. Update the public network configuration. + + Change the following fields to appropriate values: + + - IP Range Start to <Public IP Address start> + + - IP Range End to <Public IP Address end> + + - CIDR to <CIDR for Public IP Addresses> + + - Gateway to <Gateway for Public IP Addresses> + + - Check VLAN tagging. + + - Set appropriate VLAN id. + +24. Update the management network configuration. + + - Set CIDR to 172.16.255.128/25 (or as per your which). + + - Check VLAN tagging. + + - Set appropriate VLAN id. + +25. Update the Neutron L2 configuration. + + - Set VLAN ID range. + +26. Update the Neutron L3 configuration. + + - Set Internal network CIDR to an appropriate value + + - Set Internal network gateway to an appropriate value + + - Set Floating IP ranges. + + - Set DNS Servers + +27. Save Settings. + +28. Click "verify network" to check the network set-up consistency and connectivity + +29. Update the storage configuration. + +30. Open the nodes tab. + +31. Assign roles. + + - Check <Controller and Telemetry MongoDB>. + + - Check the three servers you want to be installed as Controllesr in pane <Assign Role>. + + - Click <Apply Changes>. + + - Check <Compute>. + + - Check nodes to be installed as Compute nodes in pane Assign Role. + + - Click <Apply Changes>. + +32. Configure interfaces. + + - Check Select <All> to select all nodes with Control, Telemetry . MongoDB and Compute node roles. + + - Click <Configure Interfaces> + + - Screen Configure interfaces on number of <number of nodes> nodes is shown. + - Assign interfaces (bonded) for mgmt-, admin-, private-, public- and storage networks + 6.4 Deploy the OPNFV environment -------------------------------- +**NOTE: Before the deployment is performed, the OPNFV pre-deploy script must be ran** -7 Installation health-check -============================ -<DESCRIBE ANY MEANS TO DO VERIFY THE INTEGRITY AND HEALTHYNESS OF THE INSTALL> +35. Run the pre-deploy script. + Log on as root to the Fuel node. + Print Fuel environment Id (fuel env) + #> id | status | name | mode | release_id | changes <id>| new | <CEE Region name>| ha_compact | 2 | <ite specific information> -<EXAMPLE>: +36. Run the pre-deployment script (/opt/opnfv/pre-deploy.sh <id>) + As prompted for-, set the DNS servers to go into /etc/resolv.conf. + As prompted for-, set any Hosts file additions for controllers and compute nodes. You will be prompted for name, FQDN and IP for each entry. Press return when prompted for a name when you have completed your input. + As prompted for-, set NTP upstream configuration for controllers. You will be prompted for a NTP server each entry. Press return when prompted for a NTP server when you have completed your input. + +37. Deploy the environment. + In the Fuel GUI, click Deploy Changes. + +7 Installation health-check +============================= Now that the OPNFV environment has been created, and before the post installation configurations is started, perform a system health check from the Fuel GUI: @@ -192,19 +361,10 @@ All test cases except the following should pass: 8 Post installation and deployment actions ============================================ -<DESCRIBE ANY POST INSTALLATION ACTIONS/CONFIGURATIONS NEEDED> - -<EXAMPLE>: -After the OPNFV deployment is completed, the following manual changes needs to be performed in order for the system to work according OPNFV standards. - -**Change host OS password:** -Change the Host OS password by...... +**-** 9 References ============= -<PROVIDE NEEDED/USEFUL REFERENCES> - -<EXAMPLES>: 9.1 OPNFV ------------- @@ -216,4 +376,4 @@ Change the Host OS password by...... -------------------- 9.4 Fuel -------------
\ No newline at end of file +------------ diff --git a/fuel/docs/src/release-notes.rst b/fuel/docs/src/release-notes.rst index d6b21cb..467de6e 100644 --- a/fuel/docs/src/release-notes.rst +++ b/fuel/docs/src/release-notes.rst @@ -1,20 +1,20 @@ :Authors: Jonas Bjurel (Ericsson) :Version: 0.1 -====================================================================== -OPNFV Release Note for "Arno-SRx release" - < Component denomination > -====================================================================== +================================================================ +OPNFV Release Note for "Arno-RC2 release candidate" - Fuel@OPNFV +================================================================ Abstract ======== -This document provides the release notes for <RELEASE> of <COMPONENT>. +This document provides the release notes for ARNO-RC2 release candidate of Fuel@OPNFV. License ======= -<WORK'S NAME> (c) by <AUTHOR'S NAME> +Fuel@OPNFV DOCs (c) by Jonas Bjurel (Ericsson AB) -<WORK'S NAME> is licensed under a Creative Commons Attribution 4.0 Unported License. You should have received a copy of the license along with this. If not, see <http://creativecommons.org/licenses/by/4.0/>. +Fuel@OPNFV DOCs are licensed under a Creative Commons Attribution 4.0 Unported License. You should have received a copy of the license along with this. If not, see <http://creativecommons.org/licenses/by/4.0/>. **Contents** @@ -40,54 +40,48 @@ License | **Date** | **Ver.** | **Author** | **Comment** | | | | | | +--------------------+--------------------+--------------------+--------------------+ -| 2015-04-14 | 0.1.0 | Jonas Bjurel | First draft | -| | | | | -+--------------------+--------------------+--------------------+--------------------+ -| | 0.1.1 | | | -| | | | | -+--------------------+--------------------+--------------------+--------------------+ -| | 1.0 | | | +| 2015-04-16 | 0.1.0 | Jonas Bjurel | First draft | | | | | | +--------------------+--------------------+--------------------+--------------------+ 2 Important notes =================== -<STATE IMPORTANT NOTES/DEVIATIONS SINCE PREVIOUS ITERATIVE RELEASE AND OTHER IMPORTANT NOTES FOR THIS RELEASE> +This is the first OPNFV Arno pre-release that implements the deploy stage of the OPNFV CI pipeline. -<EXAMPLE>: - -**Attention:** Please be aware that since LSV3 a pre-deploy script must be ran on the Fuel master – see the OPNFV@Fuel SW installation instructions +Carefully follow the installation-instructions and pay special attention to the pre-deploy script that needs to be ran befor deployment is started. 3 Summary =========== -<SUMMARIZE THE RELEASE - THE CONTENT - AND OTHER IMPORTANT HIGH LEVEL PROPERTIES> +Arno Fuel@OPNFV is based the OpenStack Fuel upstream project version 6.0.1, but adds OPNFV unique components such as OpenDaylight version: Helium as well as other OPNFV unique configurations. + +This Arno pre-release of Fuel@OPNFV adds the deploy stage of the OPNFV CI pipeline -<EXAMPLE>: +- Documentation is built by Jenkins +- .iso image is built by Jenkins +- Jenkins deploy an Fuel@OPNFV stack instance on a nested hypervisor environment (KVM) -Arno Fuel@OPNFV is based the OpenStack Fuel upstream project version 6.0.1, but adds OPNFV unique components such as OpenDaylight version: Helium as well as other OPNFV unique configurations...... +Automatic test of the deployed system is not part of this pre-release. 4 Release Data ================ -<STATE RELEVANT RELEASE DATA/RECORDS> - -<EXAMPLE>: +--------------------------------------+--------------------------------------+ -| **Project** | E.g. Arno/genesis/fuel@opnfv | +| **Project** | Arno/genesis/fuel | | | | +--------------------------------------+--------------------------------------+ -| **Repo/commit-ID** | E.g. genesis/adf634a0d4..... | +| **Repo/tag** | genesis/arno-rc2 | | | | +--------------------------------------+--------------------------------------+ -| **Release designation** | E.g. Arno RC2 | +| **Release designation** | Arno RC2 | | | | +--------------------------------------+--------------------------------------+ -| **Release date** | E.g. 2015-04-16 | +| **Release date** | 2015-04-16 | | | | +--------------------------------------+--------------------------------------+ -| **Purpose of the delivery** | E.g. OPNFV Internal quality assurance| +| **Purpose of the delivery** | OPNFV Internal quality assurance | +| | and CI Pipline dry-run | | | | +--------------------------------------+--------------------------------------+ @@ -96,40 +90,34 @@ Arno Fuel@OPNFV is based the OpenStack Fuel upstream project version 6.0.1, but 4.1.1 Module version changes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -<STATE WHAT UPSTREAM, - AS WELL AS OPNFV MODULE VERSIONS HAVE CHANGED> +This is the first tracked version of genesis/fuel. It is based on following upstream versions: -<EXAMPLE>: +- Fuel 6.0.1 (Juno release) -- Fuel have changed from 5.1 to 6.0.1 +- OpenDaylight Helium-SR2 -- OpenDaylight has changed from Helium-SR1 to Helium-SR2 +- Ubuntu 12.04.5 4.1.2 Document version changes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -<STATE WHAT RELATED DOCUMENTS THAT CHANGES WITH THIS RELEASE> - -<EXAMPLE>: +This is the first tracked version of genesis/fuel. It comes with the following documentation: -- The Fuel@OPNFV installation guide version has changed from version 0.1 to to 0.2 +- OPNFV Installation instructions for - Fuel@OPNFV - ver. 0.0.1 +- OPNFV Release Note for "Arno-RC2 release candidate" - Fuel@OPNFV - ver. 0.1 (this document) 4.2 Reason for version ---------------------- 4.2.1 Feature additions ~~~~~~~~~~~~~~~~~~~~~~~ -<STATE ADDED FEATURES BY REFERENCE TO JIRA> - -<EXAMPLE>: - -**JIRA BACK-LOG:** +--------------------------------------+--------------------------------------+ | **JIRA REFERENCE** | **SLOGAN** | | | | +--------------------------------------+--------------------------------------+ -| BGS-123 | ADD OpenDaylight ml2 integration | +| JIRA: | Baselining Fuel 6.0.1 for OPNFV | | | | +--------------------------------------+--------------------------------------+ -| BGS-456 | Add auto-deployment of Fuel@OPNFV | +| JIRA: | Integration of OpenDaylight | | | | +--------------------------------------+--------------------------------------+ @@ -142,10 +130,7 @@ Arno Fuel@OPNFV is based the OpenStack Fuel upstream project version 6.0.1, but | **JIRA REFERENCE** | **SLOGAN** | | | | +--------------------------------------+--------------------------------------+ -| BGS-888 | Fuel doesn't deploy | | | | -+--------------------------------------+--------------------------------------+ -| BGS-999 | Floating IP doesn't work | | | | +--------------------------------------+--------------------------------------+ @@ -154,26 +139,18 @@ Arno Fuel@OPNFV is based the OpenStack Fuel upstream project version 6.0.1, but 4.3.1 Software deliverables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -<STATE WHAT SOFTWARE DELIVERABLES THAT ARE RELATED TO THIS VERSION, AND WHERE THOSE CAN BE RETRIEVED> - -<EXAMPLE>: +Fuel@OPNFV .iso file 4.3.2 Documentation deliverables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -<STATE WHAT DOCUMENTATION DELIVERABLES THAT ARE RELATED TO THIS VERSION, AND WHERE THOSE CAN BE RETRIEVED> - -<EXAMPLE>: +- OPNFV Installation instructions for - Fuel@OPNFV - ver. 0.0.1 +- OPNFV Release Note for "Arno-RC2 release candidate" - Fuel@OPNFV - ver. 0.1 (this document) 5 Known Limitations, Issues and Workarounds ============================================ 5.1 System Limitations ------------------------- -<STATE ALL RELEVANT SYSTEM LIMITATIONS> - -<EXAMPLE>: **Max number of blades:** 1 Fuel master, 3 Controllers, 20 Compute blades @@ -187,9 +164,6 @@ Arno Fuel@OPNFV is based the OpenStack Fuel upstream project version 6.0.1, but 5.2 Known issues ------------------- -<STATE ALL KNOWN ISSUES WITH JIRA REFERENCE> - -<EXAMPLE>: **JIRA TICKETS:** @@ -197,30 +171,17 @@ Arno Fuel@OPNFV is based the OpenStack Fuel upstream project version 6.0.1, but | **JIRA REFERENCE** | **SLOGAN** | | | | +--------------------------------------+--------------------------------------+ -| BGS-987 | Nova-compute process does | -| | not re-spawn when killed | -| | | -+--------------------------------------+--------------------------------------+ -| BGS-654 | MOS 5.1 : neutron net-list returns | -| | "400 Bad request" | +| JIRA: | CentOS is not supported | | | | +--------------------------------------+--------------------------------------+ 5.3 Workarounds ------------------ +**-** -<STATE ALL KNOWN WORKAROUNDS TO THE ISSUES STATED ABOVE> - -<EXAMPLE>: - -- In case the contact with a compute is lost - restart the compute host -- In case the disk is full on a controller - delete all files in /tmp 6 Test Result ============== -<STATE THE QA COVERAGE AND RESULTS> - -<EXAMPLE>: Fuel@OPNFV Arno RC2 has undergone QA test runs with the following results: @@ -228,24 +189,12 @@ Fuel@OPNFV Arno RC2 has undergone QA test runs with the following results: | **TEST-SUITE** | **Results:** | | | | +--------------------------------------+--------------------------------------+ -| Tempest test suite 123 | Following tests failed: | -| | | -| | 1. Image resizing.... | -| | | -| | 2. Heat deploy.... | -+--------------------------------------+--------------------------------------+ -| Robot test suite 456 | Following tests failed: | -| | | -| | 1....... | -| | | -| | 2....... | +| **-** | **-** | +--------------------------------------+--------------------------------------+ + 7 References ============= -<STATE RELEVANT REFERENCES FOR THIS RELEASE/VERSION> - -<EXAMPLE>: For more information on the OPNFV Arno release, please see: diff --git a/fuel/docs/src/tmp/INSTALL/README b/fuel/docs/src/tmp/INSTALL/README deleted file mode 100644 index 456e26d..0000000 --- a/fuel/docs/src/tmp/INSTALL/README +++ /dev/null @@ -1,154 +0,0 @@ -############################################################################## -# Copyright (c) 2015 Ericsson AB and others. -# stefan.k.berg@ericsson.com -# jonas.bjurel@ericsson.com -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## - - -This README file describes how to install the OPNFV BGS Stack -============================================================= -1.1 Install Fuel Server ------------------------ -1. Mount the built .iso file (release/opnfv-<version>.iso) as a bootdevice to the fuel server. - -2. Reboot the fuel server. - The system now boots from the ISO image. - -3. Change the grub boot params - When Press Tab to edit . is shown press Tab. - Change showmenu=no to showmenu=yes. - Change netmask=255.255.255.0 to netmask=255.255.0.0. - Press Enter. - -4 Wait until screen Fuel setup . is shown. - Note: This takes about 30 minutes. - -5. Select PXE Setup and change the following fields to appropriate values (example below): - Static Pool Start 10.20.0.3 - Static Pool End 10.20.0.254 - DHCP Pool Start 10.20.128.3 - DHCP Pool End 10.20.128.254 - -6. Select DNS & Hostname and change the following fields to appropriate values: - Hostname <CEE Region name>-fuel - Domain <Domain Name> - Search Domain <Search Domain Name> - Hostname to test DNS <Hostname to test DNS> - -7. Select Time Sync and change the following fields to appropriate values: - NTP Server 1 <Customer NTP server 1> - NTP Server 2 <Customer NTP server 2> - NTP Server 3<Customer NTP server 3> - Note: This step is only to pass the network test, the actual ntp parameters will be set with the pre_deply script. - -8. Start the installation. - Select Quit Setup and press Save and Quit. - Installation starts, wait until a screen with logon credentials is shown. - Note: This takes about 15 minutes. - -10. Enable PXE Booting and put it first in the bios boot order menu. - -11. Reboot the controller- and compute blades. - -12. Connect to Fuel wit a browser towards port 8000 - -13. Create and name a new OpenStack environment, to be installed. - -14. Select Icehouse on Ubuntu . in field OpenStack Release. - -15. Select deployment mode. - Select the Multi-node with HA. - -16. Select compute node mode. - Select KVM as hypervisor. - -17. Select network mode. - Select Neutron with VLAN segmentation. - -18. Select Storage Backends. - Select Ceph for Cinder and default for glance. - - -19. Select additional services. - Check option Install Celiometer (OpenStack Telemetry). - -20. Create the new environment. - -21. Wait for availability nodes. - Wait until all nodes are displayed in top right in <total number of server> TOTAL NODES and <total number of servers> UNALLOCATED NODES. - -22. Open the created environment. - -23. Open the networks tab. - -24. Update the public configuration. - Change the following fields to appropriate values: - IP Range Start to <Public IP Address start> - IP Range End to <Public IP Address end> - CIDR to <CIDR for Public IP Addresses> - Gateway to <Gateway for Public IP Addresses> - Check VLAN tagging. - Set appropriate VLAN id. - -25. Update the management configuration. - Set CIDR to 172.16.255.128/25. - Check VLAN tagging. - Set appropriate VLAN id. - -26. Update the storage configuration. - Set CIDR to the appropriate value - Check VLAN tagging. - Set appropriate VLAN id. - -27. Update the Neutron L2 configuration. - Set VLAN ID range. - -28. Update the Neutron L3 configuration. - Set Internal network CIDR to an appropriate value - Set Internal network gateway to an appropriate value - Set Floating IP ranges. - Set DNS Servers - -29. Save Settings. - -30. Click "verify network" to check the network set-up - -31. Update storage configuration. - -32. Open the nodes tab. - -33. Assign roles. - Check Controller and Telemetry . MongoDB. - Check three nodes to be installed as Controller in pane Assign Role. - Click Apply Changes. - Check Compute. - Check nodes to be installed as Compute nodes in pane Assign Role. - Click Apply Changes. - -34. Configure interfaces. - Check Select All to select all nodes with Control, Telemetry . MongoDB and Compute node roles. - Click Configure Interfaces. - Screen Configure interfaces on number of <number of nodes> nodes is shown. - Assign interfaces (bonded) for mgmt-, admin-, private-, public- and storage networks - -35. Run the pre-deploy script. - Log on as root to the Fuel node. - Print Fuel environment Id (fuel env) - #> id | status | name | mode | release_id | changes <id>| new | <CEE Region name>| ha_compact | 2 | <ite specific information> - -36. Run the pre-deployment script (/opt/opnfv/pre-deploy.sh <id>) - As prompted for-, set the DNS servers to go into /etc/resolv.conf. - As prompted for-, set any Hosts file additions for controllers and compute nodes. You will be prompted for name, FQDN and IP for each entry. Press return when prompted for a name when you have completed your input. - As prompted for-, set NTP upstream configuration for controllers. You will be prompted for a NTP server each entry. Press return when prompted for a NTP server when you have completed your input. - -37. Deploy the environment. - In the Fuel GUI, click Deploy Changes. - -38 Verify the OpenStack Environment - Open the Health Check tab . - Select Select All. - Click Run tests. diff --git a/fuel/prototypes/libvirt/README.rst b/fuel/prototypes/libvirt/README.rst new file mode 100644 index 0000000..e0ceb6f --- /dev/null +++ b/fuel/prototypes/libvirt/README.rst @@ -0,0 +1,43 @@ +**DEA libvirt deployment prototype** + +This is an example of how to deploy a libvirt KVM setup with a DEA +YAML file. + +The file is created from an already deployed Fuel installation using +the create_dea script and helper files which are to be present on the +Fuel master and run from there. + +The install is kicked off from the host by running deploy.sh and +providing the ISO file to deploy and (optionally) an DEA file name as +an argument. If the DEA file is omitted the example one will be used +instead. + +Pre-condition 1: The host needs to be Ubuntu 14.x + +Pre-condition 2: Necessary packages installed by running +genesis/fuel/prototypes/libvirt/setup_vms/setup-vm-host.sh + +Pre-condition 3: Example VM configuration deployed by running +genesis/fuel/prototypes/libvirt/setup_vms/apply_setup.sh The VMs and +networks to be setup are in genesis/fuel/prototypes/libvirt/examples: +"vms" and "networks" + +In order to run the automated install, it's just a matter of running +genesis/fuel/prototypes/libvirt/deploy.sh <isofile> [<deafile>] The +deafile will be optional, if not specified the example one in +genesis/fuel/prototypes/libvirt/examples/libvirt_dea.yaml will be +used. + +Now either this will succeed (return code 0) or fail. I'll have a +three hours safety catch to kill off things if something is hanging, +may need to be adjusted for slow environments (see deploy.sh). + +All the steps above should be run with sudo. + +In principle the deploy.sh is assuming the example vm setup (one fuel, +three controllers, two computes) and will always deploy with full HA +and Ceilometer. + +TODO: Copy also the deployment mode in my dea.yaml creation script +genesis/fuel/prototypes/libvirt/create_dea/create_dea.sh so it's a +real xerox of the running deploy. diff --git a/fuel/prototypes/libvirt/create_dea/create_dea.sh b/fuel/prototypes/libvirt/create_dea/create_dea.sh new file mode 100755 index 0000000..87587a5 --- /dev/null +++ b/fuel/prototypes/libvirt/create_dea/create_dea.sh @@ -0,0 +1,86 @@ +#!/bin/bash +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# stefan.k.berg@ericsson.com +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +cleanup () { + if [ -n "$tmpDir" ]; then + rm -Rf $tmpDir + fi +} + +trap cleanup exit + +error_exit () { + echo "Error: $@" >&2 + exit 1 +} + +tmpDir=`mktemp -d /tmp/deaXXXX` + +export PATH=`dirname $0`:$PATH + +if [ $# -lt 1 ]; then + error_exit "Argument error" +fi +deafile=$1 +shift + +if [ $# -ne 0 ]; then + comment="$@" +fi + +if [ -f "$deafile" ]; then + error_exit "$deafile already exists" +fi + +if [ `fuel env | tail -n +3 | grep -v '^$' | wc -l` -ne 1 ]; then + error_exit "Not exactly one environment" +fi +envId=`fuel env | tail -n +3 | grep -v '^$' | awk '{ print $1 }'` + +computeId=`fuel node | grep compute | grep True | head -1 | awk '{ print $1}'` +controllerId=`fuel node | grep controller | grep True | head -1 | awk '{ print $1}'` + +if [ -z "$computeId" ]; then + error_exit "Could not find any compute node" +elif [ -z "$controllerId" ]; then + error_exit "Could not find any controller node" +fi + +fuel deployment --env $envId --download --dir $tmpDir > /dev/null || \ + error_exit "Could not get deployment info" +fuel settings --env $envId --download --dir $tmpDir > /dev/null || \ + error_exit "Could not get settings" +fuel network --env $envId --download --dir $tmpDir > /dev/null || \ + error_exit "Could not get network settings" + +echo "version: 1.0" > $deafile +echo "created: `date`" >> $deafile +if [ -n "$comment" ]; then + echo "comment: $comment" >> $deafile +fi + +reap_network_scheme.py $tmpDir/deployment_${envId}/*controller_${controllerId}.yaml $deafile controller || \ + error_exit "Could not extract network scheme for controller" +reap_network_scheme.py $tmpDir/deployment_${envId}/compute_${computeId}.yaml $deafile compute || \ + error_exit "Could not extract network scheme for controller" +reap_network_settings.py $tmpDir/network_${envId}.yaml $deafile network || \ + error_exit "Could not extract network settings" +reap_settings.py $tmpDir/settings_${envId}.yaml $deafile settings || \ + error_exit "Could not extract settings" + +fuel node --node-id $controllerId --network --download --dir $tmpDir || \ + error_exit "Could not get network info for node $controllerId" +reap_interfaces.py $tmpDir/node_${controllerId}/interfaces.yaml $deafile || \ + error_exit "Could not extract interfaces" + + +echo "DEA file is available at $deafile" + diff --git a/fuel/prototypes/libvirt/create_dea/reap_interfaces.py b/fuel/prototypes/libvirt/create_dea/reap_interfaces.py new file mode 100755 index 0000000..20a34f0 --- /dev/null +++ b/fuel/prototypes/libvirt/create_dea/reap_interfaces.py @@ -0,0 +1,45 @@ +#!/usr/bin/python +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# stefan.k.berg@ericsson.com +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +import yaml +import re +import sys +import os + +if len(sys.argv) != 3: + sys.stderr.write("Usage: "+sys.argv[0]+" <infile> <outfile>\n") + sys.exit(1) + +infile = sys.argv[1] +if not os.path.exists(infile): + sys.stderr.write("ERROR: The file "+infile+" could not be opened\n") + sys.exit(1) + +outfile = sys.argv[2] + +f1 = open(infile, 'r') +doc = yaml.load(f1) +f1.close() + +out = {} +out["interfaces"] = {} + +for interface in doc: + iface = {} + networks = [] + for network in interface["assigned_networks"]: + networks.append(network["name"]) + out["interfaces"][interface["name"]] = networks + +f2 = open(outfile, 'a') +f2.write(yaml.dump(out, default_flow_style=False)) +f2.close() + diff --git a/fuel/prototypes/libvirt/create_dea/reap_network_scheme.py b/fuel/prototypes/libvirt/create_dea/reap_network_scheme.py new file mode 100755 index 0000000..19c18bf --- /dev/null +++ b/fuel/prototypes/libvirt/create_dea/reap_network_scheme.py @@ -0,0 +1,38 @@ +#!/usr/bin/python +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# stefan.k.berg@ericsson.com +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +import yaml +import re +import sys +import os + +if len(sys.argv) != 4: + sys.stderr.write("Usage: "+sys.argv[0]+" <infile> <outfile> <outnamespace>\n") + sys.exit(1) + +infile = sys.argv[1] +if not os.path.exists(infile): + sys.stderr.write("ERROR: The file "+infile+" could not be opened\n") + sys.exit(1) + +outfile = sys.argv[2] +namespace = sys.argv[3] + +f1 = open(infile, 'r') +doc = yaml.load(f1) +f1.close() + +out = {} +out[namespace] = doc["network_scheme"]["transformations"] +f2 = open(outfile, 'a') +f2.write(yaml.dump(out, default_flow_style=False)) +f2.close() + diff --git a/fuel/prototypes/libvirt/create_dea/reap_network_settings.py b/fuel/prototypes/libvirt/create_dea/reap_network_settings.py new file mode 100755 index 0000000..bbd1fd0 --- /dev/null +++ b/fuel/prototypes/libvirt/create_dea/reap_network_settings.py @@ -0,0 +1,41 @@ +#!/usr/bin/python +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# stefan.k.berg@ericsson.com +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +import yaml +import re +import sys +import os + +if len(sys.argv) != 4: + sys.stderr.write("Usage: "+sys.argv[0]+" <infile> <outfile> <outnamespace>\n") + sys.exit(1) + +infile = sys.argv[1] +if not os.path.exists(infile): + sys.stderr.write("ERROR: The file "+infile+" could not be opened\n") + sys.exit(1) + +outfile = sys.argv[2] +namespace = sys.argv[3] + +f1 = open(infile, 'r') +doc = yaml.load(f1) +f1.close() + +for nw in doc["networks"]: + del nw["id"] + del nw["group_id"] + +out = {} +out[namespace] = doc +f2 = open(outfile, 'a') +f2.write(yaml.dump(out, default_flow_style=False)) +f2.close() diff --git a/fuel/prototypes/libvirt/create_dea/reap_settings.py b/fuel/prototypes/libvirt/create_dea/reap_settings.py new file mode 100755 index 0000000..22794d2 --- /dev/null +++ b/fuel/prototypes/libvirt/create_dea/reap_settings.py @@ -0,0 +1,37 @@ +#!/usr/bin/python +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# stefan.k.berg@ericsson.com +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +import yaml +import re +import sys +import os + +if len(sys.argv) != 4: + sys.stderr.write("Usage: "+sys.argv[0]+" <infile> <outfile> <outnamespace>\n") + sys.exit(1) + +infile = sys.argv[1] +if not os.path.exists(infile): + sys.stderr.write("ERROR: The file "+infile+" could not be opened\n") + sys.exit(1) + +outfile = sys.argv[2] +namespace = sys.argv[3] + +f1 = open(infile, 'r') +doc = yaml.load(f1) +f1.close() + +out = {} +out[namespace] = doc +f2 = open(outfile, 'a') +f2.write(yaml.dump(out, default_flow_style=False)) +f2.close() diff --git a/fuel/prototypes/libvirt/deploy/deploy.sh b/fuel/prototypes/libvirt/deploy/deploy.sh new file mode 100755 index 0000000..5d267e6 --- /dev/null +++ b/fuel/prototypes/libvirt/deploy/deploy.sh @@ -0,0 +1,100 @@ +#!/bin/bash +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# stefan.k.berg@ericsson.com +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +# Setup locations +topdir=$(cd `dirname $0`; pwd) +exampledir=$(cd $topdir/../examples; pwd) +functions=${topdir}/functions +tmpdir=$HOME/fueltmp +deployiso=${tmpdir}/deploy.iso + +# Define common functions +. ${functions}/common.sh + +exit_handler() { + # Remove safety catch + kill $killpid +} + +####### MAIN ######## + +if [ "`whoami`" != "root" ]; then + error_exit "You need be root to run this script" +fi + +if [ $# -eq 0 -o $# -gt 2 ]; then + error_exit "Argument error" +fi + +# Setup tmpdir +if [ -d $tmpdir ]; then + rm -Rf $tmpdir || error_exit "Coul not remove tmpdir $tmpdir" +fi + +mkdir $tmpdir || error_exit "Could not create tmpdir $tmpdir" + +if [ ! -f $1 ]; then + error_exit "Could not find ISO file $1" +else + isofile=$(cd `dirname $1`; echo `pwd`/`basename $1`) +fi + +# If no DEA specified, use the example one +if [ $# -eq 1 ]; then + deafile=${exampledir}/libvirt_dea.yaml +else + deafile=$(cd `dirname $2`; echo `pwd`/`basename $2`) +fi + +if [ ! -f $deafile ]; then + error-exit "Could not find DEA file $deafile" +fi + + +# Enable safety catch at three hours +(sleep 3h; kill $$) & +killpid=$! + +# Enable exit handler +trap exit_handler exit + + +# Stop all VMs +for node in controller1 controller2 controller3 compute4 compute5 fuel-master +do + virsh destroy $node >/dev/null 2>&1 +done + +# Install the Fuel master +# (Convert to functions at later stage) +echo "Patching iso file" +${functions}/patch-iso.sh $isofile $deployiso $tmpdir || error_exit "Failed to patch ISO" +# Swap isofiles from now on +isofile=$deployiso +. ${functions}/install_iso.sh +. ${functions}/deploy_env.sh + +echo "Waiting for five minutes for deploy to stabilize" +sleep 5m + +echo "Verifying node status after deployment" +# Any node with non-ready status? +ssh root@10.20.0.2 fuel node 2>/dev/null | tail -n +3 | cut -d "|" -f 2 | \ + sed 's/ //g' | grep -v ready | wc -l | grep -q "^0$" +if [ $? -ne 0 ]; then + echo "Deploy failed to verify" + ssh root@10.20.0.2 fuel node 2>/dev/null + error_exit "Exiting with error status" +else + ssh root@10.20.0.2 fuel node 2>/dev/null + echo "Deployment verified" +fi + diff --git a/fuel/prototypes/libvirt/deploy/functions/common.sh b/fuel/prototypes/libvirt/deploy/functions/common.sh new file mode 100755 index 0000000..f6cceb4 --- /dev/null +++ b/fuel/prototypes/libvirt/deploy/functions/common.sh @@ -0,0 +1,109 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# stefan.k.berg@ericsson.com +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +# Common functions + +error_exit () { + echo "Error: $@" >&2 + exit 1 +} + +ssh() { + SSHPASS="r00tme" sshpass -e ssh -o UserKnownHostsFile=/dev/null \ + -o StrictHostKeyChecking=no -o ConnectTimeout=15 "$@" +} + +scp() { + SSHPASS="r00tme" sshpass -e scp -o UserKnownHostsFile=/dev/null \ + -o StrictHostKeyChecking=no -o ConnectTimeout=15 "$@" +} + +noNodesUp () { + fuel node | grep True | wc -l +} + +fuel () { + ssh root@10.20.0.2 "fuel $@" +} + +# Return MAC id for virsh node +getNodeId() { + virsh dumpxml $1 | grep "mac address" | head -1 | sed "s/.*'..:..:..:..:\(.*\)'.*/\1/" +} + +# Wait for node with virtid name to come up +waitForHost() { + mac=`getNodeId $1` + + while true + do + fuel node --node-id $mac 2>/dev/null | grep -q True && break + sleep 3 + echo -n "." + done + echo -e "\n" +} + +# Currently not used! +# Wait for node count to increase +waitForNode() { + local cnt + local initCnt + local expectCnt + + initCnt=`noNodesUp` + expectCnt=$[initCnt+1] + while true + do + cnt=`noNodesUp` + if [ $cnt -eq $expectCnt ]; then + break + elif [ $cnt -lt $initCnt ]; then + error_exit "Node count decreased while waiting, $initCnt -> $cnt" + elif [ $cnt -gt $expectCnt ]; then + error_exit "Node count exceeded expect count, $cnt > $expectCnt" + fi + sleep 3 + echo -n "." + done + echo -e "\n" +} + +bootorder_dvdhd() { + virsh dumpxml $1 | grep -v "<boot.*>" | \ + sed "/<\/os>/i\ + <boot dev='cdrom'/\>\n\ + <boot dev='hd'/\>\n\ + <bootmenu enable='no'/\>" > $tmpdir/vm.xml || error_exit "Could not set bootorder" + virsh define $tmpdir/vm.xml || error_exit "Could not set bootorder" +} + +bootorder_hddvd() { + virsh dumpxml $1 | grep -v "<boot.*>" | \ + sed "/<\/os>/i\ + <boot dev='hd'/\>\n\ + <boot dev='cdrom'/\>\n\ + <bootmenu enable='no'/\>" > $tmpdir/vm.xml || error_exit "Could not set bootorder" + virsh define $tmpdir/vm.xml || error_exit "Could not set bootorder" +} + +addisofile() { + virsh dumpxml $1 | grep -v '\.iso' | sed "s/<.*device='cdrom'.*/<disk type='file' device='cdrom'>/" | \ + sed "/<.*device='cdrom'.*/a <source file='$2'/>" > $tmpdir/vm.xml \ + || error_exit "Could not add isofile" + virsh define $tmpdir/vm.xml || error_exit "Could not add isofile" +} + +removeisofile() { + virsh dumpxml $1 | grep -v '\.iso' | sed "s/<.*device='cdrom'.*/<disk type='block' device='cdrom'>/" \ + > $tmpdir/vm.xml \ + || error_exit "Could not remove isofile" + virsh define $tmpdir/vm.xml || error_exit "Could not remove isofile" +} diff --git a/fuel/prototypes/libvirt/deploy/functions/deploy_env.sh b/fuel/prototypes/libvirt/deploy/functions/deploy_env.sh new file mode 100755 index 0000000..6fb26c4 --- /dev/null +++ b/fuel/prototypes/libvirt/deploy/functions/deploy_env.sh @@ -0,0 +1,81 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# stefan.k.berg@ericsson.com +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +# Deploy! + +scp -q $deafile root@10.20.0.2:. || error_exit "Could not copy DEA file to Fuel" +echo "Uploading build tools to Fuel server" +ssh root@10.20.0.2 rm -rf tools || error_exit "Error cleaning old tools structure" +scp -qrp $topdir/tools root@10.20.0.2:. || error_exit "Error copying tools" + +# Refuse to run if environment already present +envcnt=`fuel env | tail -n +3 | grep -v '^$' | wc -l` +if [ $envcnt -ne 0 ]; then + error_exit "Environment count is $envcnt" +fi + +# Refuse to run if any nodes are up +nodeCnt=`noNodesUp` +if [ $nodeCnt -ne 0 ]; then + error_exit "Nodes are up (node count: $nodeCnt)" +fi + +# Extract release ID for Ubuntu environment +ubuntucnt=`fuel release | grep Ubuntu | wc -l` +if [ $ubuntucnt -ne 1 ]; then + error_exit "Not exacly one Ubuntu release found" +fi + +ubuntuid=`fuel release | grep Ubuntu | awk '{ print $1 }'` + +# Create environment +fuel env create --name Foobar --rel $ubuntuid --mode ha --network-mode neutron --net-segment-type vlan || error_exit "Error creating environment" +envId=`ssh root@10.20.0.2 fuel env | tail -n +3 | awk '{ print $1 }'` || error_exit "Could not get environment id" + + +echo "Running transplant #1" +ssh root@10.20.0.2 "cd tools; ./transplant1.sh ../`basename $deafile`" || error_exit "Error running transplant sequence #1" + +# Spin up VMs +for node in controller1 controller2 controller3 compute4 compute5 +do + echo "Starting VM $node" + virsh start $node >/dev/null 2>&1 || error_exit "Could not virsh start $node" + sleep 10 +done + +for node in controller1 controller2 controller3 +do + echo -n "Waiting for Fuel to detect $node" + waitForHost $node + echo "Setting role for $node" + fuel node set --node-id `getNodeId $node` --role controller,mongo --env $envId || error_exit "Could not set role for $node" +done + +for node in compute4 compute5 +do + echo -n "Waiting for Fuel to detect $node" + waitForHost $node + echo "Setting role for $node" + fuel node set --node-id `getNodeId $node` --role compute --env $envId || error_exit "Could not set role for $node" +done + +# Inject node network config +echo "Running transplant #2" +ssh root@10.20.0.2 "cd tools; ./transplant2.sh ../`basename $deafile`" || error_exit "Error running transplant sequence #2" + +# Run pre-deploy with default input +# Need to set terminal as script does "clear" +ssh root@10.20.0.2 "TERM=vt100 /opt/opnfv/pre-deploy.sh < /dev/null" || error_exit "Pre-deploy failed" + +# Deploy +echo "Deploying!" +ssh root@10.20.0.2 "fuel deploy-changes --env $envId" >/dev/null 2>&1 || error_exit "Deploy failed" +echo "Deployment completed" diff --git a/fuel/prototypes/libvirt/deploy/functions/install_iso.sh b/fuel/prototypes/libvirt/deploy/functions/install_iso.sh new file mode 100755 index 0000000..0a92cd5 --- /dev/null +++ b/fuel/prototypes/libvirt/deploy/functions/install_iso.sh @@ -0,0 +1,62 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# stefan.k.berg@ericsson.com +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +# Recreate disk - needed for the reboot to work +fueldisk=`virsh dumpxml fuel-master | \ + grep fuel-master.raw | sed "s/.*'\(.*\)'.*/\1/"` +disksize=`ls -l $fueldisk | awk '{ print $5 }'` +rm -f $fueldisk +fallocate -l $disksize $fueldisk + +bootorder_hddvd fuel-master +sleep 3 +addisofile fuel-master $isofile +sleep 3 +virsh start fuel-master + +# wait for node up +echo "Waiting for Fuel master to accept SSH" +while true +do + ssh root@10.20.0.2 date 2>/dev/null + if [ $? -eq 0 ]; then + break + fi + sleep 10 +done + +# Wait until fuelmenu is up +echo "Waiting for fuelmenu to come up" +menuPid="" +while [ -z "$menuPid" ] +do + menuPid=`ssh root@10.20.0.2 "ps -ef" 2>&1 | grep fuelmenu | grep -v grep | awk '{ print $2 }'` + sleep 10 +done + +# This is where we would inject our own astute.yaml + +echo "Found menu as PID $menuPid, now killing it" +ssh root@10.20.0.2 "kill $menuPid" 2>/dev/null + +# Wait until installation complete +echo "Waiting for bootstrap of Fuel node to complete" +while true +do + ssh root@10.20.0.2 "ps -ef" 2>/dev/null \ + | grep -q /usr/local/sbin/bootstrap_admin_node + if [ $? -ne 0 ]; then + break + fi + sleep 10 +done + +echo "Waiting two minutes for Fuel to stabilize" +sleep 2m diff --git a/fuel/prototypes/libvirt/deploy/functions/isolinux.cfg.patch b/fuel/prototypes/libvirt/deploy/functions/isolinux.cfg.patch new file mode 100644 index 0000000..298a057 --- /dev/null +++ b/fuel/prototypes/libvirt/deploy/functions/isolinux.cfg.patch @@ -0,0 +1,14 @@ +*** isolinux/isolinux.cfg.orig 2015-04-15 08:29:52.026868322 -0400 +--- isolinux/isolinux.cfg 2015-04-15 08:30:34.350868343 -0400 +*************** +*** 19,22 **** + menu label Fuel Install (^Static IP) + menu default + kernel vmlinuz +! append initrd=initrd.img biosdevname=0 ks=cdrom:/ks.cfg ip=10.20.0.2 gw=10.20.0.1 dns1=10.20.0.1 netmask=255.255.255.0 hostname=fuel.domain.tld showmenu=no +--- 19,22 ---- + menu label Fuel Install (^Static IP) + menu default + kernel vmlinuz +! append initrd=initrd.img biosdevname=0 ks=cdrom:/ks.cfg ip=10.20.0.2 gw=10.20.0.1 dns1=10.20.0.1 netmask=255.255.255.0 hostname=fuel.domain.tld showmenu=yes + diff --git a/fuel/prototypes/libvirt/deploy/functions/ks.cfg.patch b/fuel/prototypes/libvirt/deploy/functions/ks.cfg.patch new file mode 100644 index 0000000..1896957 --- /dev/null +++ b/fuel/prototypes/libvirt/deploy/functions/ks.cfg.patch @@ -0,0 +1,19 @@ +*** ks.cfg.orig Wed Apr 15 21:47:09 2015 +--- ks.cfg Wed Apr 15 21:47:24 2015 +*************** +*** 35,41 **** + default_drive=`echo ${drives} ${removable_drives} | awk '{print $1}'` + + installdrive="undefined" +! forceformat="no" + for I in `cat /proc/cmdline`; do case "$I" in *=*) eval $I;; esac ; done + + set ${drives} ${removable_drives} +--- 35,41 ---- + default_drive=`echo ${drives} ${removable_drives} | awk '{print $1}'` + + installdrive="undefined" +! forceformat="yes" + for I in `cat /proc/cmdline`; do case "$I" in *=*) eval $I;; esac ; done + + set ${drives} ${removable_drives} diff --git a/fuel/prototypes/libvirt/deploy/functions/patch-iso.sh b/fuel/prototypes/libvirt/deploy/functions/patch-iso.sh new file mode 100755 index 0000000..782737e --- /dev/null +++ b/fuel/prototypes/libvirt/deploy/functions/patch-iso.sh @@ -0,0 +1,69 @@ +#!/bin/bash +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# stefan.k.berg@ericsson.com +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +# This is a temporary script - this should be rolled into a separate +# build target "make ci-iso" instead! + +exit_handler() { + rm -Rf $tmpnewdir + fusermount -u $tmporigdir 2>/dev/null + test -d $tmporigdir && mdir $tmporigdir +} + +trap exit_handler exit + +error_exit() { + echo "$@" + exit 1 +} + + +top=$(cd `dirname $0`; pwd) +origiso=$(cd `dirname $1`; echo `pwd`/`basename $1`) +newiso=$(cd `dirname $2`; echo `pwd`/`basename $2`) +tmpdir=$3 +tmporigdir=/${tmpdir}/origiso +tmpnewdir=/${tmpdir}/newiso + +test -f $origiso || error_exit "Could not find origiso $origiso" +test -d $tmpdir || error_exit "Could not find tmpdir $tmpdir" + + +if [ "`whoami`" != "root" ]; then + error_exit "You need be root to run this script" +fi + +echo "Copying..." +rm -Rf $tmporigdir $tmpnewdir +mkdir -p $tmporigdir $tmpnewdir +fuseiso $origiso $tmporigdir || error_exit "Failed fuseiso" +cd $tmporigdir +find . | cpio -pd $tmpnewdir +cd $tmpnewdir +fusermount -u $tmporigdir +rmdir $tmporigdir +chmod -R 755 $tmpnewdir + +echo "Patching..." +cd $tmpnewdir +# Patch ISO to make it suitable for automatic deployment +cat $top/ks.cfg.patch | patch -p0 || error_exit "Failed patch 1" +cat $top/isolinux.cfg.patch | patch -p0 || error_exit "Failed patch 2" +rm -rf .rr_moved + +echo "Creating iso $newiso" +mkisofs -quiet -r \ + -J -R -b isolinux/isolinux.bin \ + -no-emul-boot \ + -boot-load-size 4 -boot-info-table \ + --hide-rr-moved \ + -x "lost+found" -o $newiso . || error_exit "Failed making iso" + diff --git a/fuel/prototypes/libvirt/deploy/tools/transplant1.sh b/fuel/prototypes/libvirt/deploy/tools/transplant1.sh new file mode 100755 index 0000000..9cead7a --- /dev/null +++ b/fuel/prototypes/libvirt/deploy/tools/transplant1.sh @@ -0,0 +1,67 @@ +#!/bin/bash +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# stefan.k.berg@ericsson.com +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +cleanup () { + if [ -n "$tmpDir" ]; then + rm -Rf $tmpDir + fi +} + +trap cleanup exit + +error_exit () { + echo "Error: $@" >&2 + exit 1 +} + +tmpDir=`mktemp -d /tmp/deaXXXX` + +export PATH=`dirname $0`:$PATH + +if [ $# -lt 1 ]; then + error_exit "Argument error" +fi +deafile=$1 +shift + +if [ $# -ne 0 ]; then + comment="$@" +fi + +if [ ! -f "$deafile" ]; then + error_exit "Can't find $deafile" +fi + +if [ `fuel env | tail -n +3 | grep -v '^$' | wc -l` -ne 1 ]; then + error_exit "Not exactly one environment" +fi +envId=`fuel env | tail -n +3 | grep -v '^$' | awk '{ print $1 }'` + +fuel settings --env $envId --download --dir $tmpDir > /dev/null || \ + error_exit "Could not get settings" +fuel network --env $envId --download --dir $tmpDir > /dev/null || \ + error_exit "Could not get network settings" + +cp $tmpDir/network_${envId}.yaml network_before.yaml +transplant_network_settings.py $tmpDir/network_${envId}.yaml $deafile || \ + error_exit "Could not transplant network settings" +fuel network --env $envId --upload --dir $tmpDir || \ + error_exit "Could not update network settings" +cp $tmpDir/network_${envId}.yaml network_after.yaml + +cp $tmpDir/settings_${envId}.yaml settings_before.yaml +transplant_settings.py $tmpDir/settings_${envId}.yaml $deafile || \ + error_exit "Could not transplant settings" +fuel settings --env $envId --upload --dir $tmpDir || \ + error_exit "Could not update settings" +cp $tmpDir/settings_${envId}.yaml settings_after.yaml + + diff --git a/fuel/prototypes/libvirt/deploy/tools/transplant2.sh b/fuel/prototypes/libvirt/deploy/tools/transplant2.sh new file mode 100755 index 0000000..5049f88 --- /dev/null +++ b/fuel/prototypes/libvirt/deploy/tools/transplant2.sh @@ -0,0 +1,80 @@ +#!/bin/bash +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# stefan.k.berg@ericsson.com +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +cleanup () { + if [ -n "$tmpDir" ]; then + rm -Rf $tmpDir + fi +} + +trap cleanup exit + +error_exit () { + echo "Error: $@" >&2 + exit 1 +} + +tmpDir=`mktemp -d /tmp/deaXXXX` + +export PATH=`dirname $0`:$PATH + +if [ $# -ne 1 ]; then + error_exit "Argument error" +fi +deaFile=$1 + +if [ ! -f "$deaFile" ]; then + error_exit "Can't find $deaFile" +fi + + +if [ `fuel env | tail -n +3 | grep -v '^$' | wc -l` -ne 1 ]; then + error_exit "Not exactly one environment" +fi +envId=`fuel env | tail -n +3 | grep -v '^$' | awk '{ print $1 }'` + +# Phase 1: Graft deployment information +if [ "a" == "b" ]; then +fuel deployment --env $envId --default --dir $tmpDir || \ + error_exit "Could not dump environment" + +for controller in `find $tmpDir -type f | grep -v compute` +do + transplant_network_scheme.py $controller $deaFile controller || \ + error_exit "Failed to graft `basename $controller`" +done + +for compute in `find $tmpDir -type f | grep compute` +do + transplant_network_scheme.py $compute $deaFile compute || \ + error_exit "Failed to graft `basename $compute`" +done + +fuel deployment --env $envId --upload --dir $tmpDir || \ + error_exit "Could not upload environment" +fi +# Phase 2: Graft interface information + +for nodeId in `fuel node | grep True | awk '{ print $1}'` +do + echo "Node $nodeId" + fuel node --node-id $nodeId --network --download --dir $tmpDir || \ + error_exit "Could not download node $nodeId" + + transplant_interfaces.py ${tmpDir}/node_${nodeId}/interfaces.yaml $deaFile || \ + error_exit "Failed to graft interfaces" + + fuel node --node-id $nodeId --network --upload --dir $tmpDir || \ + error_exit "Could not upload node $nodeId" +done + + + diff --git a/fuel/prototypes/libvirt/deploy/tools/transplant_interfaces.py b/fuel/prototypes/libvirt/deploy/tools/transplant_interfaces.py new file mode 100755 index 0000000..8d076ff --- /dev/null +++ b/fuel/prototypes/libvirt/deploy/tools/transplant_interfaces.py @@ -0,0 +1,66 @@ +#!/usr/bin/python +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# stefan.k.berg@ericsson.com +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +import yaml +import re +import sys +import os + +if len(sys.argv) != 3: + sys.stderr.write("Usage: "+sys.argv[0]+" <infile> <deafile>\n") + sys.exit(1) + +infile = sys.argv[1] +if not os.path.exists(infile): + sys.stderr.write("ERROR: The file "+infile+" could not be opened\n") + sys.exit(1) + +deafile = sys.argv[2] +if not os.path.exists(deafile): + sys.stderr.write("ERROR: The file "+deafile+" could not be opened\n") + sys.exit(1) +deafile = sys.argv[2] + +namespace = "interfaces" + +f1 = open(infile, 'r') +doc1 = yaml.load(f1) +f1.close() + +f2 = open(deafile, 'r') +doc2 = yaml.load(f2) +f2.close() + +# Create lookup table network name -> id for current setup +nwlookup = {} +for interface in doc1: + iface = {} + networks = [] + for network in interface["assigned_networks"]: + nwlookup[network["name"]] = network["id"] + + +out = {} +out["interfaces"] = {} + +for interface in doc1: + assigned = [] + nw = {} + interface["assigned_networks"] = [] + for nwname in doc2["interfaces"][interface["name"]]: + iface = {} + iface["id"] = nwlookup[nwname] + iface["name"] = nwname + interface["assigned_networks"].append(iface) + +f3 = open(infile, 'w') +f3.write(yaml.dump(doc1, default_flow_style=False)) +f3.close() diff --git a/fuel/prototypes/libvirt/deploy/tools/transplant_network_scheme.py b/fuel/prototypes/libvirt/deploy/tools/transplant_network_scheme.py new file mode 100755 index 0000000..7d50cbe --- /dev/null +++ b/fuel/prototypes/libvirt/deploy/tools/transplant_network_scheme.py @@ -0,0 +1,42 @@ +#!/usr/bin/python +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# stefan.k.berg@ericsson.com +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +import yaml +import re +import sys +import os + +if len(sys.argv) != 4: + sys.stderr.write("Usage: "+sys.argv[0]+" <file> <deafile> [compute|controller]\n") + sys.exit(1) + +file = sys.argv[1] +if not os.path.exists(file): + sys.stderr.write("ERROR: The file "+file+" could not be opened\n") + sys.exit(1) + +deafile = sys.argv[2] +namespace = sys.argv[3] + +f1 = open(file, 'r') +doc1 = yaml.load(f1) +f1.close() + +f2 = open(deafile, 'r') +doc2 = yaml.load(f2) +f1.close() + +doc1["network_scheme"]["transformations"] = doc2[namespace] + +f2 = open(file, 'w') +f2.write(yaml.dump(doc1, default_flow_style=False)) +f2.close() + diff --git a/fuel/prototypes/libvirt/deploy/tools/transplant_network_settings.py b/fuel/prototypes/libvirt/deploy/tools/transplant_network_settings.py new file mode 100755 index 0000000..c0a46be --- /dev/null +++ b/fuel/prototypes/libvirt/deploy/tools/transplant_network_settings.py @@ -0,0 +1,52 @@ +#!/usr/bin/python +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# stefan.k.berg@ericsson.com +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +import yaml +import re +import sys +import os + +if len(sys.argv) != 3: + sys.stderr.write("Usage: "+sys.argv[0]+" <file> <deafile>\n") + sys.exit(1) + +file = sys.argv[1] +if not os.path.exists(file): + sys.stderr.write("ERROR: The file "+file+" could not be opened\n") + sys.exit(1) + +deafile = sys.argv[2] +if not os.path.exists(deafile): + sys.stderr.write("ERROR: The file "+deafile+" could not be opened\n") + sys.exit(1) + +f1 = open(file, 'r') +doc1 = yaml.load(f1) +f1.close() + +f2 = open(deafile, 'r') +doc2 = yaml.load(f2) +f2.close() + +# Grab IDs from Fuel version, graft onto DEA version and save +id = [] +groupid = [] +for nw in doc1["networks"]: + id.append(nw["id"]) + groupid.append(nw["group_id"]) + +for nw in doc2["network"]["networks"]: + nw["id"] = id.pop(0) + nw["group_id"] = groupid.pop(0) + +f3 = open(file, 'w') +f3.write(yaml.dump(doc2["network"], default_flow_style=False)) +f3.close() diff --git a/fuel/prototypes/libvirt/deploy/tools/transplant_settings.py b/fuel/prototypes/libvirt/deploy/tools/transplant_settings.py new file mode 100755 index 0000000..7f5c0d8 --- /dev/null +++ b/fuel/prototypes/libvirt/deploy/tools/transplant_settings.py @@ -0,0 +1,36 @@ +#!/usr/bin/python +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# stefan.k.berg@ericsson.com +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +import yaml +import re +import sys +import os + +if len(sys.argv) != 3: + sys.stderr.write("Usage: "+sys.argv[0]+" <file> <deafile>\n") + sys.exit(1) + +file = sys.argv[1] +if not os.path.exists(file): + sys.stderr.write("ERROR: The file "+file+" could not be opened\n") + sys.exit(1) + +deafile = sys.argv[2] + +f1 = open(deafile, 'r') +doc = yaml.load(f1) +f1.close() + +out = doc["settings"] +f2 = open(file, 'w') +f2.write(yaml.dump(out, default_flow_style=False)) +f2.close() + diff --git a/fuel/prototypes/libvirt/examples/libvirt_dea.yaml b/fuel/prototypes/libvirt/examples/libvirt_dea.yaml new file mode 100644 index 0000000..eafbacf --- /dev/null +++ b/fuel/prototypes/libvirt/examples/libvirt_dea.yaml @@ -0,0 +1,927 @@ +version: 1.0 +created: Tue Apr 14 12:04:01 UTC 2015 +comment: The first experimental libvirt DEA +controller: +- action: add-br + name: br-eth0 +- action: add-port + bridge: br-eth0 + name: eth0 +- action: add-br + name: br-eth1 +- action: add-port + bridge: br-eth1 + name: eth1 +- action: add-br + name: br-eth2 +- action: add-port + bridge: br-eth2 + name: eth2 +- action: add-br + name: br-eth3 +- action: add-port + bridge: br-eth3 + name: eth3 +- action: add-br + name: br-ex +- action: add-br + name: br-mgmt +- action: add-br + name: br-storage +- action: add-br + name: br-fw-admin +- action: add-patch + bridges: + - br-eth1 + - br-storage + tags: + - 102 + - 0 + vlan_ids: + - 102 + - 0 +- action: add-patch + bridges: + - br-eth0 + - br-mgmt + tags: + - 101 + - 0 + vlan_ids: + - 101 + - 0 +- action: add-patch + bridges: + - br-eth0 + - br-fw-admin + trunks: + - 0 +- action: add-patch + bridges: + - br-eth3 + - br-ex + trunks: + - 0 +- action: add-br + name: br-prv +- action: add-patch + bridges: + - br-eth2 + - br-prv +compute: +- action: add-br + name: br-eth0 +- action: add-port + bridge: br-eth0 + name: eth0 +- action: add-br + name: br-eth1 +- action: add-port + bridge: br-eth1 + name: eth1 +- action: add-br + name: br-eth2 +- action: add-port + bridge: br-eth2 + name: eth2 +- action: add-br + name: br-eth3 +- action: add-port + bridge: br-eth3 + name: eth3 +- action: add-br + name: br-mgmt +- action: add-br + name: br-storage +- action: add-br + name: br-fw-admin +- action: add-patch + bridges: + - br-eth1 + - br-storage + tags: + - 102 + - 0 + vlan_ids: + - 102 + - 0 +- action: add-patch + bridges: + - br-eth0 + - br-mgmt + tags: + - 101 + - 0 + vlan_ids: + - 101 + - 0 +- action: add-patch + bridges: + - br-eth0 + - br-fw-admin + trunks: + - 0 +- action: add-br + name: br-prv +- action: add-patch + bridges: + - br-eth2 + - br-prv +network: + management_vip: 192.168.0.2 + networking_parameters: + base_mac: fa:16:3e:00:00:00 + dns_nameservers: + - 8.8.4.4 + - 8.8.8.8 + floating_ranges: + - - 172.16.0.130 + - 172.16.0.254 + gre_id_range: + - 2 + - 65535 + internal_cidr: 192.168.111.0/24 + internal_gateway: 192.168.111.1 + net_l23_provider: ovs + segmentation_type: vlan + vlan_range: + - 1000 + - 1200 + networks: + - cidr: 172.16.0.0/24 + gateway: 172.16.0.1 + ip_ranges: + - - 172.16.0.2 + - 172.16.0.126 + meta: + assign_vip: true + cidr: 172.16.0.0/24 + configurable: true + floating_range_var: floating_ranges + ip_range: + - 172.16.0.2 + - 172.16.0.126 + map_priority: 1 + name: public + notation: ip_ranges + render_addr_mask: public + render_type: null + use_gateway: true + vlan_start: null + name: public + vlan_start: null + - cidr: 192.168.0.0/24 + gateway: null + ip_ranges: + - - 192.168.0.2 + - 192.168.0.254 + meta: + assign_vip: true + cidr: 192.168.0.0/24 + configurable: true + map_priority: 2 + name: management + notation: cidr + render_addr_mask: internal + render_type: cidr + use_gateway: false + vlan_start: 101 + name: management + vlan_start: 101 + - cidr: 192.168.1.0/24 + gateway: null + ip_ranges: + - - 192.168.1.2 + - 192.168.1.254 + meta: + assign_vip: false + cidr: 192.168.1.0/24 + configurable: true + map_priority: 2 + name: storage + notation: cidr + render_addr_mask: storage + render_type: cidr + use_gateway: false + vlan_start: 102 + name: storage + vlan_start: 102 + - cidr: null + gateway: null + ip_ranges: [] + meta: + assign_vip: false + configurable: false + map_priority: 2 + name: private + neutron_vlan_range: true + notation: null + render_addr_mask: null + render_type: null + seg_type: vlan + use_gateway: false + vlan_start: null + name: private + vlan_start: null + - cidr: 10.20.0.0/24 + gateway: null + ip_ranges: + - - 10.20.0.3 + - 10.20.0.254 + meta: + assign_vip: false + configurable: false + map_priority: 0 + notation: ip_ranges + render_addr_mask: null + render_type: null + unmovable: true + use_gateway: true + name: fuelweb_admin + vlan_start: null + public_vip: 172.16.0.2 +settings: + editable: + access: + email: + description: Email address for Administrator + label: email + type: text + value: admin@localhost + weight: 40 + metadata: + label: Access + weight: 10 + password: + description: Password for Administrator + label: password + type: password + value: admin + weight: 20 + tenant: + description: Tenant (project) name for Administrator + label: tenant + regex: + error: Invalid tenant name + source: ^(?!services$)(?!nova$)(?!glance$)(?!keystone$)(?!neutron$)(?!cinder$)(?!swift$)(?!ceph$)(?![Gg]uest$).* + type: text + value: admin + weight: 30 + user: + description: Username for Administrator + label: username + regex: + error: Invalid username + source: ^(?!services$)(?!nova$)(?!glance$)(?!keystone$)(?!neutron$)(?!cinder$)(?!swift$)(?!ceph$)(?![Gg]uest$).* + type: text + value: admin + weight: 10 + additional_components: + ceilometer: + description: If selected, Ceilometer component will be installed + label: Install Ceilometer + type: checkbox + value: true + weight: 40 + heat: + description: '' + label: '' + type: hidden + value: true + weight: 30 + metadata: + label: Additional Components + weight: 20 + murano: + description: If selected, Murano component will be installed + label: Install Murano + restrictions: + - cluster:net_provider != 'neutron' + type: checkbox + value: false + weight: 20 + sahara: + description: If selected, Sahara component will be installed + label: Install Sahara + type: checkbox + value: false + weight: 10 + common: + auth_key: + description: Public key(s) to include in authorized_keys on deployed nodes + label: Public Key + type: text + value: '' + weight: 70 + auto_assign_floating_ip: + description: If selected, OpenStack will automatically assign a floating IP + to a new instance + label: Auto assign floating IP + restrictions: + - cluster:net_provider == 'neutron' + type: checkbox + value: false + weight: 40 + compute_scheduler_driver: + label: Scheduler driver + type: radio + value: nova.scheduler.filter_scheduler.FilterScheduler + values: + - data: nova.scheduler.filter_scheduler.FilterScheduler + description: Currently the most advanced OpenStack scheduler. See the OpenStack + documentation for details. + label: Filter scheduler + - data: nova.scheduler.simple.SimpleScheduler + description: This is 'naive' scheduler which tries to find the least loaded + host + label: Simple scheduler + weight: 40 + debug: + description: Debug logging mode provides more information, but requires more + disk space. + label: OpenStack debug logging + type: checkbox + value: false + weight: 20 + disable_offload: + description: If set, generic segmentation offload (gso) and generic receive + offload (gro) on physical nics will be disabled. See ethtool man. + label: Disable generic offload on physical nics + restrictions: + - action: hide + condition: cluster:net_provider == 'neutron' and networking_parameters:segmentation_type + == 'gre' + type: checkbox + value: true + weight: 80 + libvirt_type: + label: Hypervisor type + type: radio + value: kvm + values: + - data: kvm + description: Choose this type of hypervisor if you run OpenStack on hardware + label: KVM + restrictions: + - settings:common.libvirt_type.value == 'vcenter' + - data: qemu + description: Choose this type of hypervisor if you run OpenStack on virtual + hosts. + label: QEMU + restrictions: + - settings:common.libvirt_type.value == 'vcenter' + - data: vcenter + description: Choose this type of hypervisor if you run OpenStack in a vCenter + environment. + label: vCenter + restrictions: + - settings:common.libvirt_type.value != 'vcenter' or cluster:net_provider + == 'neutron' + weight: 30 + metadata: + label: Common + weight: 30 + nova_quota: + description: Quotas are used to limit CPU and memory usage for tenants. Enabling + quotas will increase load on the Nova database. + label: Nova quotas + type: checkbox + value: false + weight: 25 + resume_guests_state_on_host_boot: + description: Whether to resume previous guests state when the host reboots. + If enabled, this option causes guests assigned to the host to resume their + previous state. If the guest was running a restart will be attempted when + nova-compute starts. If the guest was not running previously, a restart + will not be attempted. + label: Resume guests state on host boot + type: checkbox + value: false + weight: 60 + use_cow_images: + description: For most cases you will want qcow format. If it's disabled, raw + image format will be used to run VMs. OpenStack with raw format currently + does not support snapshotting. + label: Use qcow format for images + type: checkbox + value: true + weight: 50 + corosync: + group: + description: '' + label: Group + type: text + value: 226.94.1.1 + weight: 10 + metadata: + label: Corosync + restrictions: + - action: hide + condition: 'true' + weight: 50 + port: + description: '' + label: Port + type: text + value: '12000' + weight: 20 + verified: + description: Set True only if multicast is configured correctly on router. + label: Need to pass network verification. + type: checkbox + value: false + weight: 10 + external_dns: + dns_list: + description: List of upstream DNS servers, separated by comma + label: DNS list + type: text + value: 8.8.8.8, 8.8.4.4 + weight: 10 + metadata: + label: Upstream DNS + weight: 90 + external_ntp: + metadata: + label: Upstream NTP + weight: 100 + ntp_list: + description: List of upstream NTP servers, separated by comma + label: NTP servers list + type: text + value: 0.pool.ntp.org, 1.pool.ntp.org + weight: 10 + kernel_params: + kernel: + description: Default kernel parameters + label: Initial parameters + type: text + value: console=ttyS0,9600 console=tty0 rootdelay=90 nomodeset + weight: 45 + metadata: + label: Kernel parameters + weight: 40 + neutron_mellanox: + metadata: + enabled: true + label: Mellanox Neutron components + toggleable: false + weight: 50 + plugin: + label: Mellanox drivers and SR-IOV plugin + type: radio + value: disabled + values: + - data: disabled + description: If selected, Mellanox drivers, Neutron and Cinder plugin will + not be installed. + label: Mellanox drivers and plugins disabled + restrictions: + - settings:storage.iser.value == true + - data: drivers_only + description: If selected, Mellanox Ethernet drivers will be installed to + support networking over Mellanox NIC. Mellanox Neutron plugin will not + be installed. + label: Install only Mellanox drivers + restrictions: + - settings:common.libvirt_type.value != 'kvm' + - data: ethernet + description: If selected, both Mellanox Ethernet drivers and Mellanox network + acceleration (Neutron) plugin will be installed. + label: Install Mellanox drivers and SR-IOV plugin + restrictions: + - settings:common.libvirt_type.value != 'kvm' or not (cluster:net_provider + == 'neutron' and networking_parameters:segmentation_type == 'vlan') + weight: 60 + vf_num: + description: Note that one virtual function will be reserved to the storage + network, in case of choosing iSER. + label: Number of virtual NICs + restrictions: + - settings:neutron_mellanox.plugin.value != 'ethernet' + type: text + value: '16' + weight: 70 + nsx_plugin: + connector_type: + description: Default network transport type to use + label: NSX connector type + type: select + value: stt + values: + - data: gre + label: GRE + - data: ipsec_gre + label: GRE over IPSec + - data: stt + label: STT + - data: ipsec_stt + label: STT over IPSec + - data: bridge + label: Bridge + weight: 80 + l3_gw_service_uuid: + description: UUID for the default L3 gateway service to use with this cluster + label: L3 service UUID + regex: + error: Invalid L3 gateway service UUID + source: '[a-f\d]{8}-[a-f\d]{4}-[a-f\d]{4}-[a-f\d]{4}-[a-f\d]{12}' + type: text + value: '' + weight: 50 + metadata: + enabled: false + label: VMware NSX + restrictions: + - action: hide + condition: cluster:net_provider != 'neutron' or networking_parameters:net_l23_provider + != 'nsx' + weight: 20 + nsx_controllers: + description: One or more IPv4[:port] addresses of NSX controller node, separated + by comma (e.g. 10.30.30.2,192.168.110.254:443) + label: NSX controller endpoint + regex: + error: Invalid controller endpoints, specify valid IPv4[:port] pair + source: ^(([\d]|[1-9][\d]|1[\d]{2}|2[0-4][\d]|25[0-5])\.){3}([\d]|[1-9][\d]|1[\d]{2}|2[0-4][\d]|25[0-5])(:(6553[0-5]|655[0-2][\d]|65[0-4][\d]{2}|6[0-4][\d]{3}|5[\d]{4}|[\d][\d]{0,3}))?(,(([\d]|[1-9][\d]|1[\d]{2}|2[0-4][\d]|25[0-5])\.){3}([\d]|[1-9][\d]|1[\d]{2}|2[0-4][\d]|25[0-5])(:(6553[0-5]|655[0-2][\d]|65[0-4][\d]{2}|6[0-4][\d]{3}|5[\d]{4}|[\d][\d]{0,3}))?)*$ + type: text + value: '' + weight: 60 + nsx_password: + description: Password for Administrator + label: NSX password + regex: + error: Empty password + source: \S + type: password + value: '' + weight: 30 + nsx_username: + description: NSX administrator's username + label: NSX username + regex: + error: Empty username + source: \S + type: text + value: admin + weight: 20 + packages_url: + description: URL to NSX specific packages + label: URL to NSX bits + regex: + error: Invalid URL, specify valid HTTP/HTTPS URL with IPv4 address (e.g. + http://10.20.0.2/nsx) + source: ^https?://(([\d]|[1-9][\d]|1[\d]{2}|2[0-4][\d]|25[0-5])\.){3}([\d]|[1-9][\d]|1[\d]{2}|2[0-4][\d]|25[0-5])(:(6553[0-5]|655[0-2][\d]|65[0-4][\d]{2}|6[0-4][\d]{3}|5[\d]{4}|[\d][\d]{0,3}))?(/.*)?$ + type: text + value: '' + weight: 70 + replication_mode: + description: '' + label: NSX cluster has Service nodes + type: checkbox + value: true + weight: 90 + transport_zone_uuid: + description: UUID of the pre-existing default NSX Transport zone + label: Transport zone UUID + regex: + error: Invalid transport zone UUID + source: '[a-f\d]{8}-[a-f\d]{4}-[a-f\d]{4}-[a-f\d]{4}-[a-f\d]{12}' + type: text + value: '' + weight: 40 + provision: + metadata: + label: Provision + restrictions: + - action: hide + condition: not ('experimental' in version:feature_groups) + weight: 80 + method: + description: Which provision method to use for this cluster. + label: Provision method + type: radio + value: cobbler + values: + - data: image + description: Copying pre-built images on a disk. + label: Image + - data: cobbler + description: Install from scratch using anaconda or debian-installer. + label: Classic (use anaconda or debian-installer) + public_network_assignment: + assign_to_all_nodes: + description: When disabled, public network will be assigned to controllers + and zabbix-server only + label: Assign public network to all nodes + type: checkbox + value: false + weight: 10 + metadata: + label: Public network assignment + restrictions: + - action: hide + condition: cluster:net_provider != 'neutron' + weight: 50 + storage: + ephemeral_ceph: + description: Configures Nova to store ephemeral volumes in RBD. This works + best if Ceph is enabled for volumes and images, too. Enables live migration + of all types of Ceph backed VMs (without this option, live migration will + only work with VMs launched from Cinder volumes). + label: Ceph RBD for ephemeral volumes (Nova) + restrictions: + - settings:common.libvirt_type.value == 'vcenter' + type: checkbox + value: false + weight: 75 + images_ceph: + description: Configures Glance to use the Ceph RBD backend to store images. + If enabled, this option will prevent Swift from installing. + label: Ceph RBD for images (Glance) + type: checkbox + value: false + weight: 30 + images_vcenter: + description: Configures Glance to use the vCenter/ESXi backend to store images. + If enabled, this option will prevent Swift from installing. + label: VMWare vCenter/ESXi datastore for images (Glance) + restrictions: + - settings:common.libvirt_type.value != 'vcenter' + type: checkbox + value: false + weight: 35 + iser: + description: 'High performance block storage: Cinder volumes over iSER protocol + (iSCSI over RDMA). This feature requires SR-IOV capabilities in the NIC, + and will use a dedicated virtual function for the storage network.' + label: iSER protocol for volumes (Cinder) + restrictions: + - settings:storage.volumes_lvm.value != true or settings:common.libvirt_type.value + != 'kvm' + type: checkbox + value: false + weight: 11 + metadata: + label: Storage + weight: 60 + objects_ceph: + description: Configures RadosGW front end for Ceph RBD. This exposes S3 and + Swift API Interfaces. If enabled, this option will prevent Swift from installing. + label: Ceph RadosGW for objects (Swift API) + restrictions: + - settings:storage.images_ceph.value == false + type: checkbox + value: false + weight: 80 + osd_pool_size: + description: Configures the default number of object replicas in Ceph. This + number must be equal to or lower than the number of deployed 'Storage - + Ceph OSD' nodes. + label: Ceph object replication factor + regex: + error: Invalid number + source: ^[1-9]\d*$ + restrictions: + - settings:common.libvirt_type.value == 'vcenter' + type: text + value: '2' + weight: 85 + vc_datacenter: + description: Inventory path to a datacenter. If you want to use ESXi host + as datastore, it should be "ha-datacenter". + label: Datacenter name + regex: + error: Empty datacenter + source: \S + restrictions: + - action: hide + condition: settings:storage.images_vcenter.value == false or settings:common.libvirt_type.value + != 'vcenter' + type: text + value: '' + weight: 65 + vc_datastore: + description: Datastore associated with the datacenter. + label: Datastore name + regex: + error: Empty datastore + source: \S + restrictions: + - action: hide + condition: settings:storage.images_vcenter.value == false or settings:common.libvirt_type.value + != 'vcenter' + type: text + value: '' + weight: 60 + vc_host: + description: IP Address of vCenter/ESXi + label: vCenter/ESXi IP + regex: + error: Specify valid IPv4 address + source: ^(([\d]|[1-9][\d]|1[\d]{2}|2[0-4][\d]|25[0-5])\.){3}([\d]|[1-9][\d]|1[\d]{2}|2[0-4][\d]|25[0-5])$ + restrictions: + - action: hide + condition: settings:storage.images_vcenter.value == false or settings:common.libvirt_type.value + != 'vcenter' + type: text + value: '' + weight: 45 + vc_image_dir: + description: The name of the directory where the glance images will be stored + in the VMware datastore. + label: Datastore Images directory + regex: + error: Empty images directory + source: \S + restrictions: + - action: hide + condition: settings:storage.images_vcenter.value == false or settings:common.libvirt_type.value + != 'vcenter' + type: text + value: /openstack_glance + weight: 70 + vc_password: + description: vCenter/ESXi admin password + label: Password + regex: + error: Empty password + source: \S + restrictions: + - action: hide + condition: settings:storage.images_vcenter.value == false or settings:common.libvirt_type.value + != 'vcenter' + type: password + value: '' + weight: 55 + vc_user: + description: vCenter/ESXi admin username + label: Username + regex: + error: Empty username + source: \S + restrictions: + - action: hide + condition: settings:storage.images_vcenter.value == false or settings:common.libvirt_type.value + != 'vcenter' + type: text + value: '' + weight: 50 + volumes_ceph: + description: Configures Cinder to store volumes in Ceph RBD images. + label: Ceph RBD for volumes (Cinder) + restrictions: + - settings:storage.volumes_lvm.value == true or settings:common.libvirt_type.value + == 'vcenter' + type: checkbox + value: false + weight: 20 + volumes_lvm: + description: Requires at least one Storage - Cinder LVM node. + label: Cinder LVM over iSCSI for volumes + restrictions: + - settings:storage.volumes_ceph.value == true + type: checkbox + value: false + weight: 10 + volumes_vmdk: + description: Configures Cinder to store volumes via VMware vCenter. + label: VMware vCenter for volumes (Cinder) + restrictions: + - settings:common.libvirt_type.value != 'vcenter' or settings:storage.volumes_lvm.value + == true + type: checkbox + value: false + weight: 15 + syslog: + metadata: + label: Syslog + weight: 50 + syslog_port: + description: Remote syslog port + label: Port + regex: + error: Invalid Syslog port + source: ^([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$ + type: text + value: '514' + weight: 20 + syslog_server: + description: Remote syslog hostname + label: Hostname + type: text + value: '' + weight: 10 + syslog_transport: + label: Syslog transport protocol + type: radio + value: tcp + values: + - data: udp + description: '' + label: UDP + - data: tcp + description: '' + label: TCP + weight: 30 + vcenter: + cluster: + description: vCenter cluster name. If you have multiple clusters, use comma + to separate names + label: Cluster + regex: + error: Invalid cluster list + source: ^([^,\ ]+([\ ]*[^,\ ])*)(,[^,\ ]+([\ ]*[^,\ ])*)*$ + type: text + value: '' + weight: 40 + datastore_regex: + description: The Datastore regexp setting specifies the data stores to use + with Compute. For example, "nas.*". If you want to use all available datastores, + leave this field blank + label: Datastore regexp + regex: + error: Invalid datastore regexp + source: ^(\S.*\S|\S|)$ + type: text + value: '' + weight: 50 + host_ip: + description: IP Address of vCenter + label: vCenter IP + regex: + error: Specify valid IPv4 address + source: ^(([\d]|[1-9][\d]|1[\d]{2}|2[0-4][\d]|25[0-5])\.){3}([\d]|[1-9][\d]|1[\d]{2}|2[0-4][\d]|25[0-5])$ + type: text + value: '' + weight: 10 + metadata: + label: vCenter + restrictions: + - action: hide + condition: settings:common.libvirt_type.value != 'vcenter' + weight: 20 + use_vcenter: + description: '' + label: '' + type: hidden + value: true + weight: 5 + vc_password: + description: vCenter admin password + label: Password + regex: + error: Empty password + source: \S + type: password + value: '' + weight: 30 + vc_user: + description: vCenter admin username + label: Username + regex: + error: Empty username + source: \S + type: text + value: '' + weight: 20 + vlan_interface: + description: Physical ESXi host ethernet adapter for VLAN networking (e.g. + vmnic1). If empty "vmnic0" is used by default + label: ESXi VLAN interface + restrictions: + - action: hide + condition: cluster:net_provider != 'nova_network' or networking_parameters:net_manager + != 'VlanManager' + type: text + value: '' + weight: 60 + zabbix: + metadata: + label: Zabbix Access + restrictions: + - action: hide + condition: not ('experimental' in version:feature_groups) + weight: 70 + password: + description: Password for Zabbix Administrator + label: password + type: password + value: zabbix + weight: 20 + username: + description: Username for Zabbix Administrator + label: username + type: text + value: admin + weight: 10 +interfaces: + eth0: + - fuelweb_admin + - management + eth1: + - storage + eth2: + - private + eth3: + - public diff --git a/fuel/prototypes/libvirt/examples/networks/fuel1 b/fuel/prototypes/libvirt/examples/networks/fuel1 new file mode 100644 index 0000000..7b2b154 --- /dev/null +++ b/fuel/prototypes/libvirt/examples/networks/fuel1 @@ -0,0 +1,12 @@ +<network> + <name>fuel1</name> + <forward mode='nat'> + <nat> + <port start='1024' end='65535'/> + </nat> + </forward> + <bridge name='fuel1' stp='on' delay='0'/> + <ip address='10.20.0.1' netmask='255.255.255.0'> + </ip> +</network> + diff --git a/fuel/prototypes/libvirt/examples/networks/fuel2 b/fuel/prototypes/libvirt/examples/networks/fuel2 new file mode 100644 index 0000000..615c920 --- /dev/null +++ b/fuel/prototypes/libvirt/examples/networks/fuel2 @@ -0,0 +1,5 @@ +<network> + <name>fuel2</name> + <bridge name='fuel2' stp='on' delay='0'/> +</network> + diff --git a/fuel/prototypes/libvirt/examples/networks/fuel3 b/fuel/prototypes/libvirt/examples/networks/fuel3 new file mode 100644 index 0000000..2383e6c --- /dev/null +++ b/fuel/prototypes/libvirt/examples/networks/fuel3 @@ -0,0 +1,5 @@ +<network> + <name>fuel3</name> + <bridge name='fuel3' stp='on' delay='0'/> +</network> + diff --git a/fuel/prototypes/libvirt/examples/networks/fuel4 b/fuel/prototypes/libvirt/examples/networks/fuel4 new file mode 100644 index 0000000..5b69f91 --- /dev/null +++ b/fuel/prototypes/libvirt/examples/networks/fuel4 @@ -0,0 +1,12 @@ +<network> + <name>fuel4</name> + <forward mode='nat'> + <nat> + <port start='1024' end='65535'/> + </nat> + </forward> + <bridge name='fuel4' stp='on' delay='0'/> + <ip address='172.16.0.1' netmask='255.255.255.0'> + </ip> +</network> + diff --git a/fuel/prototypes/libvirt/examples/vms/compute4 b/fuel/prototypes/libvirt/examples/vms/compute4 new file mode 100644 index 0000000..ec98eab --- /dev/null +++ b/fuel/prototypes/libvirt/examples/vms/compute4 @@ -0,0 +1,101 @@ +<domain type='kvm'> + <name>compute4</name> + <memory unit='KiB'>8388608</memory> + <currentMemory unit='KiB'>8388608</currentMemory> + <vcpu placement='static'>2</vcpu> + <os> + <type arch='x86_64' machine='pc-1.0'>hvm</type> + <boot dev='network'/> + <boot dev='hd'/> + <bootmenu enable='yes'/> + </os> + <features> + <acpi/> + <apic/> + <pae/> + </features> + <cpu mode='custom' match='exact'> + <model fallback='allow'>SandyBridge</model> + <vendor>Intel</vendor> + <feature policy='require' name='vme'/> + <feature policy='require' name='dtes64'/> + <feature policy='require' name='vmx'/> + <feature policy='require' name='erms'/> + <feature policy='require' name='xtpr'/> + <feature policy='require' name='smep'/> + <feature policy='require' name='pcid'/> + <feature policy='require' name='est'/> + <feature policy='require' name='monitor'/> + <feature policy='require' name='smx'/> + <feature policy='require' name='tm'/> + <feature policy='require' name='acpi'/> + <feature policy='require' name='osxsave'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='pdcm'/> + <feature policy='require' name='fsgsbase'/> + <feature policy='require' name='f16c'/> + <feature policy='require' name='ds'/> + <feature policy='require' name='tm2'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='pbe'/> + <feature policy='require' name='ds_cpl'/> + <feature policy='require' name='rdrand'/> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>restart</on_crash> + <devices> + <emulator>/usr/bin/kvm</emulator> + <disk type='file' device='disk'> + <driver name='qemu' type='raw'/> + <source file='disk.raw'/> + <target dev='vda' bus='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> + </disk> + <controller type='usb' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> + <interface type='network'> + <source network='fuel1'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> + </interface> + <interface type='network'> + <source network='fuel2'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> + </interface> + <interface type='network'> + <source network='fuel3'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> + </interface> + <interface type='network'> + <source network='fuel4'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/> + </interface> + <serial type='pty'> + <target port='0'/> + </serial> + <console type='pty'> + <target type='serial' port='0'/> + </console> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <graphics type='vnc' port='-1' autoport='yes' keymap='sv'/> + <sound model='ich6'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> + </sound> + <video> + <model type='cirrus' vram='9216' heads='1'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> + </video> + <memballoon model='virtio'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/> + </memballoon> + </devices> +</domain> + diff --git a/fuel/prototypes/libvirt/examples/vms/compute5 b/fuel/prototypes/libvirt/examples/vms/compute5 new file mode 100644 index 0000000..411be64 --- /dev/null +++ b/fuel/prototypes/libvirt/examples/vms/compute5 @@ -0,0 +1,100 @@ +<domain type='kvm'> + <name>compute5</name> + <memory unit='KiB'>8388608</memory> + <currentMemory unit='KiB'>8388608</currentMemory> + <vcpu placement='static'>2</vcpu> + <os> + <type arch='x86_64' machine='pc-1.0'>hvm</type> + <boot dev='network'/> + <boot dev='hd'/> + </os> + <features> + <acpi/> + <apic/> + <pae/> + </features> + <cpu mode='custom' match='exact'> + <model fallback='allow'>SandyBridge</model> + <vendor>Intel</vendor> + <feature policy='require' name='vme'/> + <feature policy='require' name='dtes64'/> + <feature policy='require' name='vmx'/> + <feature policy='require' name='erms'/> + <feature policy='require' name='xtpr'/> + <feature policy='require' name='smep'/> + <feature policy='require' name='pcid'/> + <feature policy='require' name='est'/> + <feature policy='require' name='monitor'/> + <feature policy='require' name='smx'/> + <feature policy='require' name='tm'/> + <feature policy='require' name='acpi'/> + <feature policy='require' name='osxsave'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='pdcm'/> + <feature policy='require' name='fsgsbase'/> + <feature policy='require' name='f16c'/> + <feature policy='require' name='ds'/> + <feature policy='require' name='tm2'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='pbe'/> + <feature policy='require' name='ds_cpl'/> + <feature policy='require' name='rdrand'/> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>restart</on_crash> + <devices> + <emulator>/usr/bin/kvm</emulator> + <disk type='file' device='disk'> + <driver name='qemu' type='raw'/> + <source file='disk.raw'/> + <target dev='vda' bus='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> + </disk> + <controller type='usb' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> + <interface type='network'> + <source network='fuel1'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> + </interface> + <interface type='network'> + <source network='fuel2'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> + </interface> + <interface type='network'> + <source network='fuel3'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> + </interface> + <interface type='network'> + <source network='fuel4'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/> + </interface> + <serial type='pty'> + <target port='0'/> + </serial> + <console type='pty'> + <target type='serial' port='0'/> + </console> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <graphics type='vnc' port='-1' autoport='yes' keymap='sv'/> + <sound model='ich6'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> + </sound> + <video> + <model type='cirrus' vram='9216' heads='1'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> + </video> + <memballoon model='virtio'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/> + </memballoon> + </devices> +</domain> + diff --git a/fuel/prototypes/libvirt/examples/vms/controller1 b/fuel/prototypes/libvirt/examples/vms/controller1 new file mode 100644 index 0000000..f82ad28 --- /dev/null +++ b/fuel/prototypes/libvirt/examples/vms/controller1 @@ -0,0 +1,100 @@ +<domain type='kvm'> + <name>controller1</name> + <memory unit='KiB'>2097152</memory> + <currentMemory unit='KiB'>2097152</currentMemory> + <vcpu placement='static'>2</vcpu> + <os> + <type arch='x86_64' machine='pc-1.0'>hvm</type> + <boot dev='network'/> + <boot dev='hd'/> + </os> + <features> + <acpi/> + <apic/> + <pae/> + </features> + <cpu mode='custom' match='exact'> + <model fallback='allow'>SandyBridge</model> + <vendor>Intel</vendor> + <feature policy='require' name='vme'/> + <feature policy='require' name='dtes64'/> + <feature policy='require' name='vmx'/> + <feature policy='require' name='erms'/> + <feature policy='require' name='xtpr'/> + <feature policy='require' name='smep'/> + <feature policy='require' name='pcid'/> + <feature policy='require' name='est'/> + <feature policy='require' name='monitor'/> + <feature policy='require' name='smx'/> + <feature policy='require' name='tm'/> + <feature policy='require' name='acpi'/> + <feature policy='require' name='osxsave'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='pdcm'/> + <feature policy='require' name='fsgsbase'/> + <feature policy='require' name='f16c'/> + <feature policy='require' name='ds'/> + <feature policy='require' name='tm2'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='pbe'/> + <feature policy='require' name='ds_cpl'/> + <feature policy='require' name='rdrand'/> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>restart</on_crash> + <devices> + <emulator>/usr/bin/kvm</emulator> + <disk type='file' device='disk'> + <driver name='qemu' type='raw'/> + <source file='disk.raw'/> + <target dev='vda' bus='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> + </disk> + <controller type='usb' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> + <interface type='network'> + <source network='fuel1'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> + </interface> + <interface type='network'> + <source network='fuel2'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> + </interface> + <interface type='network'> + <source network='fuel3'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> + </interface> + <interface type='network'> + <source network='fuel4'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/> + </interface> + <serial type='pty'> + <target port='0'/> + </serial> + <console type='pty'> + <target type='serial' port='0'/> + </console> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <graphics type='vnc' port='-1' autoport='yes' keymap='sv'/> + <sound model='ich6'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> + </sound> + <video> + <model type='cirrus' vram='9216' heads='1'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> + </video> + <memballoon model='virtio'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/> + </memballoon> + </devices> +</domain> + diff --git a/fuel/prototypes/libvirt/examples/vms/controller2 b/fuel/prototypes/libvirt/examples/vms/controller2 new file mode 100644 index 0000000..63ad86a --- /dev/null +++ b/fuel/prototypes/libvirt/examples/vms/controller2 @@ -0,0 +1,100 @@ +<domain type='kvm'> + <name>controller2</name> + <memory unit='KiB'>2097152</memory> + <currentMemory unit='KiB'>2097152</currentMemory> + <vcpu placement='static'>2</vcpu> + <os> + <type arch='x86_64' machine='pc-1.0'>hvm</type> + <boot dev='network'/> + <boot dev='hd'/> + </os> + <features> + <acpi/> + <apic/> + <pae/> + </features> + <cpu mode='custom' match='exact'> + <model fallback='allow'>SandyBridge</model> + <vendor>Intel</vendor> + <feature policy='require' name='vme'/> + <feature policy='require' name='dtes64'/> + <feature policy='require' name='vmx'/> + <feature policy='require' name='erms'/> + <feature policy='require' name='xtpr'/> + <feature policy='require' name='smep'/> + <feature policy='require' name='pcid'/> + <feature policy='require' name='est'/> + <feature policy='require' name='monitor'/> + <feature policy='require' name='smx'/> + <feature policy='require' name='tm'/> + <feature policy='require' name='acpi'/> + <feature policy='require' name='osxsave'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='pdcm'/> + <feature policy='require' name='fsgsbase'/> + <feature policy='require' name='f16c'/> + <feature policy='require' name='ds'/> + <feature policy='require' name='tm2'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='pbe'/> + <feature policy='require' name='ds_cpl'/> + <feature policy='require' name='rdrand'/> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>restart</on_crash> + <devices> + <emulator>/usr/bin/kvm</emulator> + <disk type='file' device='disk'> + <driver name='qemu' type='raw'/> + <source file='disk.raw'/> + <target dev='vda' bus='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> + </disk> + <controller type='usb' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> + <interface type='network'> + <source network='fuel1'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> + </interface> + <interface type='network'> + <source network='fuel2'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> + </interface> + <interface type='network'> + <source network='fuel3'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> + </interface> + <interface type='network'> + <source network='fuel4'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/> + </interface> + <serial type='pty'> + <target port='0'/> + </serial> + <console type='pty'> + <target type='serial' port='0'/> + </console> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <graphics type='vnc' port='-1' autoport='yes' keymap='sv'/> + <sound model='ich6'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> + </sound> + <video> + <model type='cirrus' vram='9216' heads='1'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> + </video> + <memballoon model='virtio'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/> + </memballoon> + </devices> +</domain> + diff --git a/fuel/prototypes/libvirt/examples/vms/controller3 b/fuel/prototypes/libvirt/examples/vms/controller3 new file mode 100644 index 0000000..7c64a9d --- /dev/null +++ b/fuel/prototypes/libvirt/examples/vms/controller3 @@ -0,0 +1,100 @@ +<domain type='kvm'> + <name>controller3</name> + <memory unit='KiB'>2097152</memory> + <currentMemory unit='KiB'>2097152</currentMemory> + <vcpu placement='static'>2</vcpu> + <os> + <type arch='x86_64' machine='pc-1.0'>hvm</type> + <boot dev='network'/> + <boot dev='hd'/> + </os> + <features> + <acpi/> + <apic/> + <pae/> + </features> + <cpu mode='custom' match='exact'> + <model fallback='allow'>SandyBridge</model> + <vendor>Intel</vendor> + <feature policy='require' name='vme'/> + <feature policy='require' name='dtes64'/> + <feature policy='require' name='vmx'/> + <feature policy='require' name='erms'/> + <feature policy='require' name='xtpr'/> + <feature policy='require' name='smep'/> + <feature policy='require' name='pcid'/> + <feature policy='require' name='est'/> + <feature policy='require' name='monitor'/> + <feature policy='require' name='smx'/> + <feature policy='require' name='tm'/> + <feature policy='require' name='acpi'/> + <feature policy='require' name='osxsave'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='pdcm'/> + <feature policy='require' name='fsgsbase'/> + <feature policy='require' name='f16c'/> + <feature policy='require' name='ds'/> + <feature policy='require' name='tm2'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='pbe'/> + <feature policy='require' name='ds_cpl'/> + <feature policy='require' name='rdrand'/> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>restart</on_crash> + <devices> + <emulator>/usr/bin/kvm</emulator> + <disk type='file' device='disk'> + <driver name='qemu' type='raw'/> + <source file='disk.raw'/> + <target dev='vda' bus='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> + </disk> + <controller type='usb' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> + <interface type='network'> + <source network='fuel1'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> + </interface> + <interface type='network'> + <source network='fuel2'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> + </interface> + <interface type='network'> + <source network='fuel3'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> + </interface> + <interface type='network'> + <source network='fuel4'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/> + </interface> + <serial type='pty'> + <target port='0'/> + </serial> + <console type='pty'> + <target type='serial' port='0'/> + </console> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <graphics type='vnc' port='-1' autoport='yes' keymap='sv'/> + <sound model='ich6'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> + </sound> + <video> + <model type='cirrus' vram='9216' heads='1'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> + </video> + <memballoon model='virtio'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/> + </memballoon> + </devices> +</domain> + diff --git a/fuel/prototypes/libvirt/examples/vms/fuel-master b/fuel/prototypes/libvirt/examples/vms/fuel-master new file mode 100644 index 0000000..1b2d86f --- /dev/null +++ b/fuel/prototypes/libvirt/examples/vms/fuel-master @@ -0,0 +1,95 @@ +<domain type='kvm'> + <name>fuel-master</name> + <memory unit='KiB'>2097152</memory> + <currentMemory unit='KiB'>2097152</currentMemory> + <vcpu placement='static'>2</vcpu> + <os> + <type arch='x86_64' machine='pc-1.0'>hvm</type> + <boot dev='hd'/> + <boot dev='cdrom'/> + <bootmenu enable='yes'/> + </os> + <features> + <acpi/> + <apic/> + <pae/> + </features> + <cpu mode='custom' match='exact'> + <model fallback='allow'>SandyBridge</model> + <vendor>Intel</vendor> + <feature policy='require' name='vme'/> + <feature policy='require' name='dtes64'/> + <feature policy='require' name='vmx'/> + <feature policy='require' name='erms'/> + <feature policy='require' name='xtpr'/> + <feature policy='require' name='smep'/> + <feature policy='require' name='pcid'/> + <feature policy='require' name='est'/> + <feature policy='require' name='monitor'/> + <feature policy='require' name='smx'/> + <feature policy='require' name='tm'/> + <feature policy='require' name='acpi'/> + <feature policy='require' name='osxsave'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='pdcm'/> + <feature policy='require' name='fsgsbase'/> + <feature policy='require' name='f16c'/> + <feature policy='require' name='ds'/> + <feature policy='require' name='tm2'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='pbe'/> + <feature policy='require' name='ds_cpl'/> + <feature policy='require' name='rdrand'/> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>restart</on_crash> + <devices> + <emulator>/usr/bin/kvm</emulator> + <disk type='file' device='cdrom'> + <driver name='qemu' type='raw'/> + <target dev='hdc' bus='ide'/> + <readonly/> + <address type='drive' controller='0' bus='1' target='0' unit='0'/> + </disk> + <disk type='file' device='disk'> + <driver name='qemu' type='raw'/> + <source file='disk.raw'/> + <target dev='vda' bus='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> + </disk> + <controller type='ide' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> + </controller> + <controller type='usb' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> + <interface type='network'> + <source network='fuel1'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> + </interface> + <serial type='pty'> + <target port='0'/> + </serial> + <console type='pty'> + <target type='serial' port='0'/> + </console> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <graphics type='vnc' port='-1' autoport='yes' keymap='sv'/> + <sound model='ich6'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> + </sound> + <video> + <model type='cirrus' vram='9216' heads='1'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> + </video> + <memballoon model='virtio'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/> + </memballoon> + </devices> +</domain> + diff --git a/fuel/prototypes/libvirt/setup_vms/apply_setup.sh b/fuel/prototypes/libvirt/setup_vms/apply_setup.sh new file mode 100755 index 0000000..1598d66 --- /dev/null +++ b/fuel/prototypes/libvirt/setup_vms/apply_setup.sh @@ -0,0 +1,61 @@ +#!/bin/bash +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# stefan.k.berg@ericsson.com +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +error_exit () { + echo "$@" + exit 1 +} + +netdir='../examples/networks' +vmdir='../examples/vms' +tmpfile=/tmp/foo + +if [ ! -d $netdir ]; then + error_exit "No net directory $netdir" + exit 1 +elif [ ! -d $vmdir ]; then + error_exit "No VM directory $vmdir" + exit 1 +fi + +if [ $# -ne 2 ]; then + echo "Argument error." + echo "`basename $0` <path to storage dir> <size in GB of disk per VM>" + exit 1 +fi + +storagedir=$1 +size=$2 + +if [ ! -d $storagedir ]; then + error_exit "Could not find storagedir directory $storagedir" +fi + +# Create storage space and patch it in +for vm in $vmdir/* +do + storage=${storagedir}/`basename ${vm}`.raw + if [ -f ${storage} ]; then + error_exit "Storage already present: ${storage}" + fi + echo "Creating ${size} GB of storage in ${storage}" + fallocate -l ${size}G ${storage} || \ + error_exit "Could not create storage" + sed "s:<source file='disk.raw':<source file='${storage}':" $vm >$tmpfile + virsh define $tmpfile +done + +for net in $netdir/* +do + virsh net-define $net + virsh net-autostart `basename $net` + virsh net-start `basename $net` +done diff --git a/fuel/prototypes/libvirt/setup_vms/dump_setup.sh b/fuel/prototypes/libvirt/setup_vms/dump_setup.sh new file mode 100755 index 0000000..b65cf31 --- /dev/null +++ b/fuel/prototypes/libvirt/setup_vms/dump_setup.sh @@ -0,0 +1,59 @@ +#!/bin/bash +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# stefan.k.berg@ericsson.com +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +netdir='../examples/networks' +vmdir='../examples/vms' + +if [ -d $netdir ]; then + echo "Net directory already present" + exit 1 +elif [ -d $vmdir ]; then + echo "VM directory already present" + exit 1 +fi + +mkdir -p $netdir +mkdir -p $vmdir + +# Check that no VM is up +if virsh list | egrep -q "fuel-master|controller|compute" ; then + echo "Can't dump while VMs are up:" + virsh list | egrep "fuel-master|controller|compute" + exit 1 +fi + +# Dump all networks in the fuell* namespace +for net in `virsh net-list --all | tail -n+3 | awk '{ print $1 }' | grep fuel` +do + virsh net-dumpxml $net > $netdir/$net +done + +# Dump all fuel-master, compute* and controller* VMs +for vm in `virsh list --all | tail -n+3 | awk '{ print $2 }' | egrep 'fuel-master|compute|controller'` +do + virsh dumpxml $vm > $vmdir/$vm +done + +# Remove all attached ISOs, generalize the rest of the setup +for vm in $vmdir/* +do + sed -i '/.iso/d' $vm + sed -i "s/<source file='.*raw'/<source file='disk.raw'/" $vm + sed -i '/<uuid/d' $vm + sed -i '/<mac/d' $vm +done + +# Generalize all nets +for net in $netdir/* +do + sed -i '/<uuid/d' $net + sed -i '/<mac/d' $net +done diff --git a/fuel/prototypes/libvirt/setup_vms/setup-vm-host.sh b/fuel/prototypes/libvirt/setup_vms/setup-vm-host.sh new file mode 100755 index 0000000..58ce19a --- /dev/null +++ b/fuel/prototypes/libvirt/setup_vms/setup-vm-host.sh @@ -0,0 +1,16 @@ +#!/bin/bash +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# stefan.k.berg@ericsson.com +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +# Tools for installation on the libvirt server/base host +# +apt-get install -y libvirt-bin qemu-kvm tightvncserver virt-manager \ + sshpass fuseiso genisoimage blackbox xterm +restart libvirt-bin |