onetemplate
- manages OpenNebula templates
onetemplate
command [args] [options]
--name name Name of the new VM or TEMPLATE. When
instantiating multiple VMs you can use the "%i"
wildcard to produce different names such as
vm-0, vm-1...
--cpu cpu CPU percentage reserved for the VM (1=100% one
CPU)
--vcpu vcpu Number of virtualized CPUs
--arch arch Architecture of the VM, e.g.: i386 or x86_64
--memory memory Memory amount given to the VM. By default the
unit is megabytes. To use gigabytes add a 'g',
floats can be used: 8g=8192, 0.5g=512
--disk image0,image1 Disks to attach. To use an image owned by other
user use user[disk]. Add any additional
attributes separated by ':' and in the shape of
KEY=VALUE. For example, if the disk must be
resized, use image0:size=1000 . Or
image0:size=1000:target=vda,image1:target=vdb
--nic network0,network1 Networks to attach. To use a network owned by
other user use user[network]. Additional
attributes are supported like with the --disk
option. Also you can use auto if you want that
OpenNebula select automatically the network
--raw string Raw string to add to the template. Not to be
confused with the RAW attribute
--vnc Add VNC server to the VM
--vnc-password password VNC password
--vnc-listen ip VNC IP where to listen for connections. By
default is 0.0.0.0 (all interfaces).
--vnc-keymap keymap VNC keyboard layout
--spice Add spice server to the VM
--spice-password password spice password
--spice-listen ip spice IP where to listen for connections. By
default is 0.0.0.0 (all interfaces).
--spice-keymap keymap spice keyboard layout
--ssh [file] Add an ssh public key to the context. If the file
is omited then the user variable SSH_PUBLIC_KEY
will be used.
--net_context Add network contextualization parameters
--context line1,line2,line3 Lines to add to the context section
--boot device_list Set boot device list e.g. disk0,disk2,nic0
--files_ds file1,file2 Add files to the contextualization CD from
thefiles datastore
--init script1,script2 Script or scripts to start in context
--startscript [file] Start script to be executed
--report_ready Sends READY=YES to OneGate, useful for OneFlow
--vcenter_vm_folder path In a vCenter environment sets the the VMs and
Template folder where the VM will be placed in.
The path uses slashes to separate folders. For
example: --vcenter_vm_folder "/Management/VMs"
--as_gid gid The Group ID to instantiate the VM
--as_uid uid The User ID to instantiate the VM
--dry Just print the template
--recursive Applies the action to the template plus any image
defined in DISK
-m, --multiple x Instance multiple VMs
--userdata userdata Integrate userdata into the EC2 section
--hold Creates the new VM on hold state instead of
pending
--persistent Creates a private persistent copy of the template
plus any image defined in DISK, and instantiates
that copy
-a, --append Append new attributes to the current template
-l, --list x,y,z Selects columns to display with list command
-c, --listconf conf Selects a predefined column list
-d, --delay x Sets the delay in seconds for top command
-f, --filter x,y,z Filter data. An array is specified with
column=value pairs.
--operator operator Logical operator used on filters: AND, OR.
Default: AND.
--csv Write table in csv format
--csv-del del Set delimiter for csv output
--no-pager Disable pagination
--no-header Hides the header of the table
--adjust x,y,z Adjust size to not truncate selected columns
-s, --size x=size,y=size Change the size of selected columns. For example:
$ onevm list --size "name=20" will make column
name size 20.
--expand [x=prop,y=prop] Expands the columns size to fill the terminal.
For example: $onevm list --expand
name=0.4,group=0.6 will expand name 40% and
group 60%. $onevm list --expand name,group will
expand name and group based on its size.$onevm
list --expand will expand all columns.
--no-expand Disable expand
-x, --xml Show the resource in xml format
-n, --numeric Do not translate user and group IDs
--describe Describe list columns
--extended Process the template and included extended
information, such as the SIZE for each DISK
--use lock use actions
--manage lock manage actions
--admin lock admin actions
--all lock all actions
-v, --verbose Verbose mode
-h, --help Show this message
-V, --version Show version and copyright information
--user name User name used to connect to OpenNebula
--password password Password to authenticate with OpenNebula
--endpoint endpoint URL of OpenNebula xmlrpc frontend
create [file] Creates a new VM Template from the given description
Examples:
- using a VM Template description file:
onetemplate create vm_description.tmpl
- new VM Template named "arch vm" with a disk and a nic:
onetemplate create --name "arch vm" --memory 128 --cpu 1 \
--disk arch --network private_lan
- using two disks:
onetemplate create --name "test vm" --memory 128 --cpu 1 \
--disk arch,data
valid options: name, cpu, vcpu, arch, memory, disk, nic, raw, vnc, vnc_password, vnc_listen, vnc_keymap, spice, spice_password, spice_listen, spice_keymap, ssh, net_context, context, boot, files_ds, init, startscript, report_ready, vcenter_vm_folder, as_gid, as_uid, dry
clone templateid name Creates a new Template from an existing one valid options: recursive
delete range|templateid_list Deletes the given Template valid options: recursive
instantiate templateid [file] Creates a new VM instance from the given Template. This VM can be managed with the 'onevm' command.
The source Template can be modified adding or replacing attributes with
the optional file argument, or with the options.
valid options: name, multiple, userdata, hold, persistent, cpu, vcpu, arch, memory, disk, nic, raw, vnc, vnc_password, vnc_listen, vnc_keymap, spice, spice_password, spice_listen, spice_keymap, ssh, net_context, context, boot, files_ds, init, startscript, report_ready, vcenter_vm_folder, as_gid, as_uid
chgrp range|templateid_list groupid Changes the Template group
chown range|templateid_list userid [groupid] Changes the Template owner and group
chmod range|templateid_list octet Changes the Template permissions valid options: recursive
update templateid [file] Update the template contents. If a path is not provided the editor will be launched to modify the current content. valid options: append
rename templateid name Renames the Template
list [filterflag] Lists Templates in the pool valid options: list, listconf, delay, filter, operator, csv, csv_del, no_pager, no_header, adjust, size, expand, no_expand, xml, numeric, describe
show templateid Shows information for the given Template valid options: xml, extended
top [filterflag] Lists Templates continuously valid options: list, listconf, delay, filter, operator, csv, csv_del, no_pager, no_header, adjust, size, expand, no_expand, xml, numeric, describe
lock templateid Locks a VM with differents levels for lock any actions with this VM, show and monitoring never will be locked. Valid states are: All. Levels: [Use]: locks Admin, Manage and Use actions. [Manage]: locks Manage and Use actions. [Admin]: locks only Admin actions. valid options: use, manage, admin, all
unlock templateid Unlocks a VM for unlock any actions with this VM. Valid states are: All.
file Path to a file
range List of id's in the form 1,8..15
text String
groupid OpenNebula GROUP name or id
userid OpenNebula USER name or id
templateid OpenNebula VMTEMPLATE name or id
templateid_list Comma-separated list of OpenNebula VMTEMPLATE names or ids
filterflag a, all all the known VMTEMPLATEs m, mine the VMTEMPLATE belonging to the user in ONE_AUTH g, group 'mine' plus the VMTEMPLATE belonging to the groups the user is member of G, primary group the VMTEMPLATE owned the user's primary group uid VMTEMPLATE of the user identified by this uid user VMTEMPLATE of the user identified by the username
OpenNebula 5.10.1 Copyright 2002-2019, OpenNebula Project, OpenNebula Systems
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0