Statistics
| Branch: | Tag: | Revision:

one / share / man / onevm.1 @ f93e2be0

History | View | Annotate | Download (16.1 KB)

1
.\" generated with Ronn/v0.7.3
2
.\" http://github.com/rtomayko/ronn/tree/0.7.3
3
.
4
.TH "ONEVM" "1" "July 2017" "" "onevm(1) -- manages OpenNebula virtual machines"
5
.
6
.SH "NAME"
7
\fBonevm\fR \- manages OpenNebula virtual machines
8
.
9
.SH "SYNOPSIS"
10
\fBonevm\fR \fIcommand\fR [\fIargs\fR] [\fIoptions\fR]
11
.
12
.SH "OPTIONS"
13
.
14
.nf
15

    
16
 \-m, \-\-multiple x          Instance multiple VMs
17
 \-\-hold                    Creates the new VM on hold state instead of
18
                           pending
19
 \-\-name name               Name for the new VM
20
 \-\-cpu cpu                 CPU percentage reserved for the VM (1=100% one
21
                           CPU)
22
 \-\-vcpu vcpu               Number of virtualized CPUs
23
 \-\-arch arch               Architecture of the VM, e\.g\.: i386 or x86_64
24
 \-\-memory memory           Memory amount given to the VM\. By default the
25
                           unit is megabytes\. To use gigabytes add a \'g\',
26
                           floats can be used: 8g=8192, 0\.5g=512
27
 \-\-disk image0,image1      Disks to attach\. To use an image owned by other
28
                           user use user[disk]\. Add any additional
29
                           attributes separated by \':\' and in the shape of
30
                           KEY=VALUE\. For example, if the disk must be
31
                           resized, use image0:size=1000 \. Or
32
                           image0:size=1000:target=vda,image1:target=vdb
33
 \-\-nic network0,network1   Networks to attach\. To use a network owned by
34
                           other user use user[network]\. Additional
35
                           attributes are supported like with the \-\-disk
36
                           option\.
37
 \-\-raw string              Raw string to add to the template\. Not to be
38
                           confused with the RAW attribute
39
 \-\-vnc                     Add VNC server to the VM
40
 \-\-vnc\-password password   VNC password
41
 \-\-vnc\-listen ip           VNC IP where to listen for connections\. By
42
                           default is 0\.0\.0\.0 (all interfaces)\.
43
 \-\-vnc\-keymap keymap       VNC keyboard layout
44
 \-\-spice                   Add spice server to the VM
45
 \-\-spice\-password password spice password
46
 \-\-spice\-listen ip         spice IP where to listen for connections\. By
47
                           default is 0\.0\.0\.0 (all interfaces)\.
48
 \-\-spice\-keymap keymap     spice keyboard layout
49
 \-\-ssh [file]              Add an ssh public key to the context\. If the file
50
                           is omited then the user variable SSH_PUBLIC_KEY
51
                           will be used\.
52
 \-\-net_context             Add network contextualization parameters
53
 \-\-context line1,line2,line3 Lines to add to the context section
54
 \-\-boot device_list        Set boot device list e\.g\. disk0,disk2,nic0
55
 \-\-files_ds file1,file2    Add files to the contextualization CD from
56
                           thefiles datastore
57
 \-\-init script1,script2    Script or scripts to start in context
58
 \-\-startscript [file]      Start script to be executed
59
 \-\-report_ready            Sends READY=YES to OneGate, useful for OneFlow
60
 \-\-vcenter_vm_folder path  In a vCenter environment sets the the VMs and
61
                           Template folder where the VM will be placed in\.
62
                           The path uses slashes to separate folders\. For
63
                           example: \-\-vcenter_vm_folder "/Management/VMs"
64
 \-\-dry                     Just print the template
65
 \-a, \-\-append              Append new attributes to the current template
66
 \-\-schedule TIME           Schedules this action to be executed afterthe
67
                           given time\. For example: onevm resume 0
68
                           \-\-schedule "09/23 14:15"
69
 \-t, \-\-type type           Type of the new Image
70
 \-s, \-\-snapshot snapshot   ID of the Snapshot to save\.
71
 \-\-hard                    Does not communicate with the guest OS
72
 \-e, \-\-enforce             Enforce that the host capacity is not exceeded
73
 \-\-live                    Do the action with the VM running
74
 \-\-success                 Recover a VM by succeeding the pending action
75
 \-\-failure                 Recover a VM by failing the pending action
76
 \-\-retry                   Recover a VM by retrying the last failed action
77
 \-\-interactive             Enables interactive recovery\. Only works
78
                           alongside the \-\-retry option\.
79
 \-\-delete                  No recover action possible, delete the VM
80
 \-\-recreate                No recover action possible, delete and recreate
81
                           the VM
82
 \-f, \-\-file file           Selects the template file
83
 \-i, \-\-image id|name       Selects the image
84
 \-t, \-\-target target       Device where the image will be attached
85
 \-\-cache cache_mode        Hypervisor cache mode: default, none,
86
                           writethrough, writeback, directsync or unsafe\.
87
                           (Only KVM driver)
88
 \-\-discard discard_mode    Hypervisor discard mode: ignore or unmap\. (Only
89
                           KVM driver)
90
 \-\-prefix prefix           Overrides the DEV_PREFIX of the image
91
 \-n, \-\-network id|name     Selects the virtual network
92
 \-i, \-\-ip ip               IP address for the new NIC
93
 \-l, \-\-list x,y,z          Selects columns to display with list command
94
 \-c, \-\-listconf conf       Selects a predefined column list
95
 \-d, \-\-delay x             Sets the delay in seconds for top command
96
 \-f, \-\-filter x,y,z        Filter data\. An array is specified with
97
                           column=value pairs\.
98
 \-\-csv                     Write table in csv format
99
 \-x, \-\-xml                 Show the resource in xml format
100
 \-n, \-\-numeric             Do not translate user and group IDs
101
 \-k, \-\-kilobytes           Show units in kilobytes
102
 \-\-describe                Describe list columns
103
 \-\-all                     Show all template data
104
 \-\-persistent              Make the new images persistent
105
 \-v, \-\-verbose             Verbose mode
106
 \-h, \-\-help                Show this message
107
 \-V, \-\-version             Show version and copyright information
108
 \-\-user name               User name used to connect to OpenNebula
109
 \-\-password password       Password to authenticate with OpenNebula
110
 \-\-endpoint endpoint       URL of OpenNebula xmlrpc frontend
111
.
112
.fi
113
.
114
.SH "COMMANDS"
115
.
116
.IP "\(bu" 4
117
create [\fIfile\fR] Creates a new VM from the given description instead of using a previously defined template (see \'onetemplate create\' and \'onetemplate instantiate\')\.
118
.
119
.IP "" 4
120
.
121
.nf
122

    
123
Examples:
124

    
125
  \- using a template description file:
126

    
127
    onevm create vm_description\.tmpl
128

    
129
  \- new VM named "arch vm" with a disk and a nic
130

    
131
    onevm create \-\-name "arch vm" \-\-memory 128 \-\-cpu 1 \-\-disk arch \e
132
                 \-\-network private_lan
133

    
134
  \- a vm with two disks
135

    
136
    onevm create \-\-name "test vm" \-\-memory 128 \-\-cpu 1 \-\-disk arch,data
137
valid options: multiple, hold, 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, dry
138
.
139
.fi
140
.
141
.IP "" 0
142

    
143
.
144
.IP "\(bu" 4
145
update \fIvmid\fR [\fIfile\fR] Update the user template contents\. If a path is not provided the editor will be launched to modify the current content\. valid options: append
146
.
147
.IP "\(bu" 4
148
hold \fIrange|vmid_list\fR Sets the given VM on hold\. A VM on hold is not scheduled until it is released\. It can be, however, deployed manually; see \'onevm deploy\'
149
.
150
.IP "" 4
151
.
152
.nf
153

    
154
States: PENDING
155
valid options: schedule
156
.
157
.fi
158
.
159
.IP "" 0
160

    
161
.
162
.IP "\(bu" 4
163
release \fIrange|vmid_list\fR Releases a VM on hold\. See \'onevm hold\'
164
.
165
.IP "" 4
166
.
167
.nf
168

    
169
States: HOLD
170
valid options: schedule
171
.
172
.fi
173
.
174
.IP "" 0
175

    
176
.
177
.IP "\(bu" 4
178
disk\-saveas \fIvmid\fR \fIdiskid\fR \fIimg_name\fR Saves the specified VM disk as a new Image\. The Image is created immediately, and the contents of the VM disk will be saved to it\.
179
.
180
.IP "" 4
181
.
182
.nf
183

    
184
States: ANY
185
valid options: type, snapshot
186
.
187
.fi
188
.
189
.IP "" 0
190

    
191
.
192
.IP "\(bu" 4
193
terminate \fIrange|vmid_list\fR Terminates the given VM\. The VM life cycle will end\.
194
.
195
.IP "" 4
196
.
197
.nf
198

    
199
With \-\-hard it unplugs the VM\.
200

    
201
States: valid if no operation is being performed on the VM
202
valid options: schedule, hard
203
.
204
.fi
205
.
206
.IP "" 0
207

    
208
.
209
.IP "\(bu" 4
210
undeploy \fIrange|vmid_list\fR Shuts down the given VM\. The VM is saved in the system Datastore\.
211
.
212
.IP "" 4
213
.
214
.nf
215

    
216
With \-\-hard it unplugs the VM\.
217

    
218
States: RUNNING
219
valid options: schedule, hard
220
.
221
.fi
222
.
223
.IP "" 0
224

    
225
.
226
.IP "\(bu" 4
227
poweroff \fIrange|vmid_list\fR Powers off the given VM\. The VM will remain in the poweroff state, and can be powered on with the \'onevm resume\' command\.
228
.
229
.IP "" 4
230
.
231
.nf
232

    
233
States: RUNNING
234
valid options: schedule, hard
235
.
236
.fi
237
.
238
.IP "" 0
239

    
240
.
241
.IP "\(bu" 4
242
reboot \fIrange|vmid_list\fR Reboots the given VM, this is equivalent to execute the reboot command from the VM console\.
243
.
244
.IP "" 4
245
.
246
.nf
247

    
248
The VM will be ungracefully rebooted if \-\-hard is used\.
249

    
250
States: RUNNING
251
valid options: schedule, hard
252
.
253
.fi
254
.
255
.IP "" 0
256

    
257
.
258
.IP "\(bu" 4
259
deploy \fIrange|vmid_list\fR \fIhostid\fR [\fIdatastoreid\fR] Deploys the given VM in the specified Host\. This command forces the deployment, in a standard installation the Scheduler is in charge of this decision
260
.
261
.IP "" 4
262
.
263
.nf
264

    
265
States: PENDING, HOLD, STOPPED, UNDEPLOYED
266
valid options: enforce
267
.
268
.fi
269
.
270
.IP "" 0
271

    
272
.
273
.IP "\(bu" 4
274
migrate \fIrange|vmid_list\fR \fIhostid\fR [\fIdatastoreid\fR] Migrates the given running VM to another Host\. If used with \-\-live parameter the miration is done without downtime\.
275
.
276
.IP "" 4
277
.
278
.nf
279

    
280
States: RUNNING
281
valid options: enforce, live
282
.
283
.fi
284
.
285
.IP "" 0
286

    
287
.
288
.IP "\(bu" 4
289
stop \fIrange|vmid_list\fR Stops a running VM\. The VM state is saved and transferred back to the front\-end along with the disk files
290
.
291
.IP "" 4
292
.
293
.nf
294

    
295
States: RUNNING
296
valid options: schedule
297
.
298
.fi
299
.
300
.IP "" 0
301

    
302
.
303
.IP "\(bu" 4
304
suspend \fIrange|vmid_list\fR Saves a running VM\. It is the same as \'onevm stop\', but the files are left in the remote machine to later restart the VM there (i\.e\. the resources are not freed and there is no need to re\-schedule the VM)\.
305
.
306
.IP "" 4
307
.
308
.nf
309

    
310
States: RUNNING
311
valid options: schedule
312
.
313
.fi
314
.
315
.IP "" 0
316

    
317
.
318
.IP "\(bu" 4
319
resume \fIrange|vmid_list\fR Resumes the execution of the a saved VM
320
.
321
.IP "" 4
322
.
323
.nf
324

    
325
States: STOPPED, SUSPENDED, UNDEPLOYED, POWEROFF, UNKNOWN
326
valid options: schedule
327
.
328
.fi
329
.
330
.IP "" 0
331

    
332
.
333
.IP "\(bu" 4
334
recover \fIrange|vmid_list\fR Recovers a stuck VM that is waiting for a driver operation\. The recovery may be done by failing, succeeding or retrying the current operation\. YOU NEED TO MANUALLY CHECK THE VM STATUS ON THE HOST, to decide if the operation was successful or not, or if it can be retried\.
335
.
336
.IP "" 4
337
.
338
.nf
339

    
340
Example: A VM is stuck in "migrate" because of a hardware failure\. You
341
need to check if the VM is running in the new host or not to recover
342
the vm with \-\-success or \-\-failure, respectively\.
343

    
344
States for success/failure recovers: Any ACTIVE state\.
345
States for a retry recover: Any *FAILURE state
346
States for delete: Any
347
States for delete\-recreate: Any but STOP/UNDEPLOYED
348
valid options: success, failure, retry, interactive, delete, recreate
349
.
350
.fi
351
.
352
.IP "" 0
353

    
354
.
355
.IP "\(bu" 4
356
disk\-attach \fIvmid\fR Attaches a disk to a running VM\. When using \-\-file add only one DISK instance\.
357
.
358
.IP "" 4
359
.
360
.nf
361

    
362
States: RUNNING, POWEROFF
363
valid options: file, image, target, cache, discard, prefix
364
.
365
.fi
366
.
367
.IP "" 0
368

    
369
.
370
.IP "\(bu" 4
371
disk\-detach \fIvmid\fR \fIdiskid\fR Detaches a disk from a running VM
372
.
373
.IP "" 4
374
.
375
.nf
376

    
377
States: RUNNING, POWEROFF
378
.
379
.fi
380
.
381
.IP "" 0
382

    
383
.
384
.IP "\(bu" 4
385
nic\-attach \fIvmid\fR Attaches a NIC to a running VM\. When using \-\-file add only one NIC instance\.
386
.
387
.IP "" 4
388
.
389
.nf
390

    
391
States: RUNNING, POWEROFF
392
valid options: file, network, ip
393
.
394
.fi
395
.
396
.IP "" 0
397

    
398
.
399
.IP "\(bu" 4
400
nic\-detach \fIvmid\fR \fInicid\fR Detaches a NIC from a running VM
401
.
402
.IP "" 4
403
.
404
.nf
405

    
406
States: RUNNING, POWEROFF
407
.
408
.fi
409
.
410
.IP "" 0
411

    
412
.
413
.IP "\(bu" 4
414
chgrp \fIrange|vmid_list\fR \fIgroupid\fR Changes the VM group
415
.
416
.IP "\(bu" 4
417
chown \fIrange|vmid_list\fR \fIuserid\fR [\fIgroupid\fR] Changes the VM owner and group
418
.
419
.IP "\(bu" 4
420
chmod \fIrange|vmid_list\fR \fIoctet\fR Changes the VM permissions
421
.
422
.IP "\(bu" 4
423
resched \fIrange|vmid_list\fR Sets the rescheduling flag for the VM\.
424
.
425
.IP "" 4
426
.
427
.nf
428

    
429
States: RUNNING
430
.
431
.fi
432
.
433
.IP "" 0
434

    
435
.
436
.IP "\(bu" 4
437
unresched \fIrange|vmid_list\fR Clears the rescheduling flag for the VM\.
438
.
439
.IP "" 4
440
.
441
.nf
442

    
443
States: RUNNING
444
.
445
.fi
446
.
447
.IP "" 0
448

    
449
.
450
.IP "\(bu" 4
451
rename \fIvmid\fR \fIname\fR Renames the VM
452
.
453
.IP "\(bu" 4
454
snapshot\-create \fIrange|vmid_list\fR [\fIname\fR] Creates a new VM snapshot valid options: schedule
455
.
456
.IP "\(bu" 4
457
snapshot\-revert \fIvmid\fR \fIsnapshot_id\fR Reverts a VM to a saved snapshot
458
.
459
.IP "\(bu" 4
460
snapshot\-delete \fIvmid\fR \fIsnapshot_id\fR Delets a snapshot of a VM
461
.
462
.IP "\(bu" 4
463
disk\-snapshot\-create \fIvmid\fR \fIdiskid\fR \fIname\fR Takes a new snapshot of the given disk\. This operation needs support from the Datastore drivers: QCOW2 or Ceph\.
464
.
465
.IP "" 4
466
.
467
.nf
468

    
469
States: RUNNING, POWEROFF, SUSPENDED
470
.
471
.fi
472
.
473
.IP "" 0
474

    
475
.
476
.IP "\(bu" 4
477
disk\-snapshot\-revert \fIvmid\fR \fIdiskid\fR \fIsnapshot_id\fR Reverts disk state to a previously taken snapshot\.
478
.
479
.IP "" 4
480
.
481
.nf
482

    
483
States: POWEROFF, SUSPENDED
484
.
485
.fi
486
.
487
.IP "" 0
488

    
489
.
490
.IP "\(bu" 4
491
disk\-snapshot\-delete \fIvmid\fR \fIdiskid\fR \fIsnapshot_id\fR Deletes a disk snapshot\.
492
.
493
.IP "" 4
494
.
495
.nf
496

    
497
States: RUNNING, POWEROFF, SUSPENDED
498
.
499
.fi
500
.
501
.IP "" 0
502

    
503
.
504
.IP "\(bu" 4
505
disk\-resize \fIvmid\fR \fIdiskid\fR \fIsize\fR Resizes a VM disk\. The new size should be larger than the old one\.
506
.
507
.IP "" 4
508
.
509
.nf
510

    
511
States: RUNNING, POWEROFF
512
.
513
.fi
514
.
515
.IP "" 0
516

    
517
.
518
.IP "\(bu" 4
519
list [\fIfilterflag\fR] Lists VMs in the pool valid options: list, listconf, delay, filter, csv, xml, numeric, kilobytes, describe
520
.
521
.IP "\(bu" 4
522
show \fIvmid\fR Shows information for the given VM valid options: xml, all
523
.
524
.IP "\(bu" 4
525
top [\fIfilterflag\fR] Lists Images continuously valid options: list, listconf, delay, filter, csv, xml, numeric, kilobytes
526
.
527
.IP "\(bu" 4
528
resize \fIvmid\fR Resizes the capacity of a Virtual Machine (offline, the VM cannot be RUNNING) valid options: cpu, vcpu, memory, enforce, file
529
.
530
.IP "\(bu" 4
531
save \fIvmid\fR \fIname\fR Clones the VM\'s source Template, replacing the disks with live snapshots of the current disks\. The VM capacity and NICs are also preserved
532
.
533
.IP "" 4
534
.
535
.nf
536

    
537
States: POWEROFF
538
valid options: persistent
539
.
540
.fi
541
.
542
.IP "" 0
543

    
544
.
545
.IP "\(bu" 4
546
updateconf \fIvmid\fR [\fIfile\fR] Updates the configuration of a VM\. The VM cannot be in an active (running) state, valid states are: pending, failure, poweroff, undeploy, hold or cloning\.
547
.
548
.IP "" 4
549
.
550
.nf
551

    
552
This command accepts a template file or opens an editor, the full list of
553
configuration attributes are:
554

    
555
OS       = ["ARCH", "MACHINE", "KERNEL", "INITRD", "BOOTLOADER", "BOOT"]
556
FEATURES = ["ACPI", "PAE", "APIC", "LOCALTIME", "HYPERV", "GUEST_AGENT"]
557
INPUT    = ["TYPE", "BUS"]
558
GRAPHICS = ["TYPE", "LISTEN", "PASSWD", "KEYMAP" ]
559
RAW      = ["DATA", "DATA_VMX", "TYPE"]
560
CONTEXT (any value, **variable substitution will be made**)
561
.
562
.fi
563
.
564
.IP "" 0
565

    
566
.
567
.IP "" 0
568
.
569
.SH "ARGUMENT FORMATS"
570
.
571
.IP "\(bu" 4
572
file Path to a file
573
.
574
.IP "\(bu" 4
575
range List of id\'s in the form 1,8\.\.15
576
.
577
.IP "\(bu" 4
578
text String
579
.
580
.IP "\(bu" 4
581
hostid OpenNebula HOST name or id
582
.
583
.IP "\(bu" 4
584
groupid OpenNebula GROUP name or id
585
.
586
.IP "\(bu" 4
587
userid OpenNebula USER name or id
588
.
589
.IP "\(bu" 4
590
datastoreid OpenNebula DATASTORE name or id
591
.
592
.IP "\(bu" 4
593
vmid OpenNebula VM name or id
594
.
595
.IP "\(bu" 4
596
vmid_list Comma\-separated list of OpenNebula VM names or ids
597
.
598
.IP "\(bu" 4
599
filterflag a, all all the known VMs m, mine the VM belonging to the user in ONE_AUTH g, group \'mine\' plus the VM belonging to the groups the user is member of G, primary group the VM owned the user\'s primary group uid VM of the user identified by this uid user VM of the user identified by the username
600
.
601
.IP "\(bu" 4
602
diskid Integer
603
.
604
.IP "\(bu" 4
605
size Disk size in MiB
606
.
607
.IP "" 0
608
.
609
.SH "LICENSE"
610
OpenNebula 5\.4\.0 Copyright 2002\-2017, OpenNebula Project, OpenNebula Systems
611
.
612
.P
613
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