Opennebula 5.4 Operation Guide Release 5.4.5
Total Page:16
File Type:pdf, Size:1020Kb
OpenNebula 5.4 Operation Guide Release 5.4.5 OpenNebula Systems Dec 12, 2017 This document is being provided by OpenNebula Systems under the Creative Commons Attribution-NonCommercial- Share Alike License. THE DOCUMENT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IM- PLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE DOCUMENT. i CONTENTS 1 Hosts and Clusters Management1 1.1 Overview.................................................1 1.2 Hosts...................................................1 1.3 Clusters..................................................8 1.4 Scheduler................................................. 12 1.5 Datastores................................................ 16 2 Users and Groups 20 2.1 Overview................................................. 20 2.2 Managing Users............................................. 21 2.3 Managing Groups............................................ 30 2.4 Managing VDCs............................................. 36 2.5 Managing Permissions.......................................... 39 2.6 Managing ACL Rules.......................................... 42 2.7 Managing Quotas............................................. 47 2.8 Accounting Client............................................ 53 2.9 Showback................................................. 61 3 Virtual Network Management 66 3.1 Overview................................................. 66 3.2 Virtual Networks............................................. 66 3.3 Virtual Routers.............................................. 73 3.4 Security Groups............................................. 77 4 Virtual Machine Management 82 4.1 Overview................................................. 82 4.2 Managing Images............................................ 82 4.3 Managing Virtual Machine Templates.................................. 91 4.4 Managing Virtual Machines Instances.................................. 107 4.5 vCenter Specifics............................................. 129 5 Virtual Machine Setup 137 5.1 Overview................................................. 137 5.2 KVM Contextualization......................................... 137 5.3 vCenter Contextualization and Customization.............................. 141 5.4 vCenter Contextualization........................................ 141 5.5 Adding Content to Your Cloud...................................... 147 6 Cloud End-User 158 6.1 Overview................................................. 158 6.2 Self-service Cloud View......................................... 158 ii 6.3 Group Admin View........................................... 171 7 References 183 7.1 Overview................................................. 183 7.2 Virtual Machine Definition Template.................................. 183 7.3 Virtual Machines States Reference.................................... 205 7.4 Image Definition Template........................................ 207 7.5 Virtual Network Definition........................................ 210 7.6 Command Line Interface......................................... 214 iii CHAPTER ONE HOSTS AND CLUSTERS MANAGEMENT 1.1 Overview A Host is a server that has the ability to run Virtual Machines and that is connected to OpenNebula’s Front-end server. OpenNebula can work with Hosts with a heterogeneous configuration, i.e. you can connect Hosts to the same OpenNebula with different hypervisors or Linux distributions. To learn how to prepare the hosts you can read the Node Installation guide. Clusters are pools of hosts that share datastores and virtual networks. 1.1.1 How Should I Read This Chapter In this chapter there are four guides describing these objects. • Host Management: Host management is achieved through the onehost CLI command or through the Sun- stone GUI. You can read about Host Management in more detail in the Managing Hosts guide. • Cluster Management: Hosts can be grouped in Clusters. These Clusters are managed with the onecluster CLI command, or through the Sunstone GUI. You can read about Cluster Management in more detail in the Managing Clusters guide. • Scheduler: Where you’ll learn how to change the scheduling configuration to suit your needs. For example changing the scheduling policies or the number of VMs that will be sent per host. • Datastore: Where you’ll learn about how to confgure and manage the different types of datastore types. You should read all the guides in this chapter to familiarize with these objects. For small and homogeneous clouds you may not need to create new clusters. 1.1.2 Hypervisor Compatibility These guides are compatible with both KVM and vCenter hypervisors. 1.2 Hosts In order to use your existing physical nodes, you have to add them to the system as OpenNebula Hosts. To add a host only its hostname and type is needed. Hosts are usually organized in Clusters, you can read more about it in the Managing Clusters guide. 1 OpenNebula 5.4 Operation Guide, Release 5.4.5 Warning: Before adding a KVM host check that you can ssh to it without being prompt for a password. 1.2.1 Create and Delete Hosts Hosts are the servers managed by OpenNebula responsible for Virtual Machine execution. To use these hosts in OpenNebula you need to register them so they are monitored and made available to the scheduler. Creating a host: $ onehost create host01 --im kvm --vm kvm ID:0 The parameters are: • --im/-i: Information Manager driver. • --vm/-v: Virtual Machine Manager driver. To remove a host, just like with other OpenNebula commands, you can either specify it by ID or by name. The following commands are equivalent: $ onehost delete host01 $ onehost delete0 1.2.2 Showing and Listing Hosts To display information about a single host the show command is used: HOST0 INFORMATION ID :0 NAME : server CLUSTER : server STATE : MONITORED IM_MAD : kvm VM_MAD : kvm LAST MONITORING TIME : 05/28 00:30:51 HOST SHARES TOTAL MEM :7.3G USED MEM(REAL):4.4G USED MEM(ALLOCATED) : 1024M TOTAL CPU : 400 USED CPU(REAL): 28 USED CPU(ALLOCATED): 100 RUNNING VMS :1 LOCAL SYSTEM DATASTORE #0 CAPACITY TOTAL: : 468.4G USED: : 150.7G FREE: : 314.7G MONITORING INFORMATION ARCH="x86_64" CPUSPEED="1599" HOSTNAME="server" 1.2. Hosts 2 OpenNebula 5.4 Operation Guide, Release 5.4.5 HYPERVISOR="kvm" IM_MAD="kvm" MODELNAME="Intel(R) Core(TM) i7-4650U CPU @ 1.70GHz" NETRX="0" NETTX="0" RESERVED_CPU="" RESERVED_MEM="" VERSION="5.00.0" VM_MAD="kvm" WILD VIRTUAL MACHINES NAME IMPORT_ID CPU MEMORY VIRTUAL MACHINES ID USER GROUP NAME STAT UCPU UMEM HOST TIME 13 oneadmin oneadmin kvm1-13 runn0.0 1024M server 8d 06h14 The information of a host contains: • General information of the hosts including its name and the drivers used to interact with it. • Capacity information (Host Shares) for CPU and memory. • Local datastore information (Local System Datastore) if the Host is configured to use a local datastore (e.g. Filesystem in ssh transfer mode). • Monitoring Information, including PCI devices • Virtual Machines running on the hosts. Wild are virtual machines running on the host but not started by Open- Nebula, they can be imported into OpenNebula. To see a list of all the hosts: $ onehost list ID NAME CLUSTER RVM ALLOCATED_CPU ALLOCATED_MEM STAT 0 server server1 100/ 400(25%) 1024M /7.3G(13%) on 1 kvm1 kvm0 - - off 2 kvm2 kvm0 - - off The above information can be also displayed in XML format using -x. 1.2.3 Host Life-cycle: Enable, Disable, Offline and Flush In order to manage the life cycle of a host it can be set to different operation modes: enabled (on), disabled (dsbl) and offline (off). The different operation status for each mode is described by the following table: 1.2. Hosts 3 OpenNebula 5.4 Operation Guide, Release 5.4.5 OP. MODE MONITORINGVM DEPLOY- MEANING MENT MAN- SCHED UAL ENABLED Yes Yes Yes The host is fully operational (on) UPDATE Yes Yes Yes The host is being monitored (update) DISABLED Yes Yes No Disabled, e.g. to perform maintenance operations (dsbl) OFFLINE No No No Host is totally offline (off) ERROR (err) Yes Yes No Error while monitoring the host, use onehost show for the error description. RETRY Yes Yes No Monitoring a host in error state (retry) The onehost tool includes three commands to set the operation mode of a host: disable, offline and enable, for example: $ onehost disable0 To re-enable the host use the enable command: $ onehost enable0 Similarly to put the host offline: $ onehost offline0 The flush command will mark all the running VMs in the specified host as to be rescheduled, which means that they will be migrated to another server with enough capacity. At the same time, the specified host will be disabled, so no more Virtual Machines are deployed in it. This command is useful to clean a host of running VMs. 1.2.4 Custom Host Tags & Scheduling Policies The Host attributes are inserted by the monitoring probes that run from time to time on the nodes to get information. The administrator can add custom attributes either creating a probe in the host, or updating the host information with: onehost update. For example to label a host as production we can add a custom tag TYPE: $ onehost update ... TYPE="production" This tag can be used at a later time for scheduling purposes by adding the following section in a VM template: SCHED_REQUIREMENTS="TYPE=\"production\""