Statistics
| Branch: | Tag: | Revision:

one / share / man / onevm.1 @ f3d57119

History | View | Annotate | Download (14.5 KB)

1
.\" generated with Ronn/v0.7.3
2
.\" http://github.com/rtomayko/ronn/tree/0.7.3
3
.
4
.TH "ONEVM" "1" "August 2015" "" "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
 \-\-spice                   Add spice server to the VM
44
 \-\-spice\-password password spice password
45
 \-\-spice\-listen ip         spice IP where to listen for connections\. By
46
                           default is 0\.0\.0\.0 (all interfaces)\.
47
 \-\-ssh [file]              Add an ssh public key to the context\. If the file
48
                           is omited then the user variable SSH_PUBLIC_KEY
49
                           will be used\.
50
 \-\-net_context             Add network contextualization parameters
51
 \-\-context line1,line2,line3 Lines to add to the context section
52
 \-\-boot device             Select boot device (hd|fd|cdrom|network)
53
 \-\-files_ds file1,file2    Add files to the contextualization CD from
54
                           thefiles datastore
55
 \-\-init script1,script2    Script or scripts to start in context
56
 \-\-dry                     Just print the template
57
 \-a, \-\-append              Append new attributes to the current template
58
 \-\-schedule TIME           Schedules this action to be executed afterthe
59
                           given time\. For example: onevm resume 0
60
                           \-\-schedule "09/23 14:15"
61
 \-\-recreate                Resubmits a fresh VM
62
 \-t, \-\-type type           Type of the new Image
63
 \-s, \-\-snapshot snapshot   ID of the Snapshot to save\.
64
 \-\-hard                    Does not communicate with the guest OS
65
 \-e, \-\-enforce             Enforce that the host capacity is not exceeded
66
 \-\-live                    Do the action with the VM running
67
 \-\-success                 Recover a VM by succeeding the pending action
68
 \-\-failure                 Recover a VM by failing the pending action
69
 \-\-retry                   Recover a VM by retrying the last failed action
70
 \-\-interactive             Enables interactive recovery\. Only works
71
                           alongside the \-\-retry option\.
72
 \-f, \-\-file file           Selects the template file
73
 \-i, \-\-image id|name       Selects the image
74
 \-t, \-\-target target       Device where the image will be attached
75
 \-\-cache cache_mode        Hypervisor cache mode: default, none,
76
                           writethrough, writeback, directsync or unsafe\.
77
                           (Only KVM driver)
78
 \-\-discard discard_mode    Hypervisor discard mode: ignore or unmap\. (Only
79
                           KVM driver)
80
 \-\-prefix prefix           Overrides the DEV_PREFIX of the image
81
 \-n, \-\-network id|name     Selects the virtual network
82
 \-i, \-\-ip ip               IP address for the new NIC
83
 \-l, \-\-list x,y,z          Selects columns to display with list command
84
 \-d, \-\-delay x             Sets the delay in seconds for top command
85
 \-f, \-\-filter x,y,z        Filter data\. An array is specified with
86
                           column=value pairs\.
87
 \-\-csv                     Write table in csv format
88
 \-x, \-\-xml                 Show the resource in xml format
89
 \-n, \-\-numeric             Do not translate user and group IDs
90
 \-k, \-\-kilobytes           Show units in kilobytes
91
 \-\-describe                Describe list columns
92
 \-\-all                     Show all template data
93
 \-v, \-\-verbose             Verbose mode
94
 \-h, \-\-help                Show this message
95
 \-V, \-\-version             Show version and copyright information
96
 \-\-user name               User name used to connect to OpenNebula
97
 \-\-password password       Password to authenticate with OpenNebula
98
 \-\-endpoint endpoint       URL of OpenNebula xmlrpc frontend
99
.
100
.fi
101
.
102
.SH "COMMANDS"
103
.
104
.IP "\(bu" 4
105
create [\fIfile\fR] Creates a new VM from the given description instead of using a previously defined template (see \'onetemplate create\' and \'onetemplate instantiate\')\.
106
.
107
.IP "" 4
108
.
109
.nf
110

    
111
Examples:
112

    
113
  \- using a template description file:
114

    
115
    onevm create vm_description\.tmpl
116

    
117
  \- new VM named "arch vm" with a disk and a nic
118

    
119
    onevm create \-\-name "arch vm" \-\-memory 128 \-\-cpu 1 \-\-disk arch \e
120
                 \-\-network private_lan
121

    
122
  \- a vm with two disks
123

    
124
    onevm create \-\-name "test vm" \-\-memory 128 \-\-cpu 1 \-\-disk arch,data
125
valid options: multiple, hold, name, cpu, vcpu, arch, memory, disk, nic, raw, vnc, vnc_password, vnc_listen, spice, spice_password, spice_listen, ssh, net_context, context, boot, files_ds, init, dry
126
.
127
.fi
128
.
129
.IP "" 0
130

    
131
.
132
.IP "\(bu" 4
133
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
134
.
135
.IP "\(bu" 4
136
delete \fIrange|vmid_list\fR Deletes the given VM\. Using \-\-recreate resubmits the VM\.
137
.
138
.IP "" 4
139
.
140
.nf
141

    
142
Resubmits the VM to PENDING state\. This is intended for VMs stuck in a
143
transient state\. To re\-deploy a fresh copy of the same VM, create a
144
Template and instantiate it, see \'onetemplate instantiate\'
145

    
146
States: ANY
147
valid options: schedule, recreate
148
.
149
.fi
150
.
151
.IP "" 0
152

    
153
.
154
.IP "\(bu" 4
155
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\'
156
.
157
.IP "" 4
158
.
159
.nf
160

    
161
States: PENDING
162
valid options: schedule
163
.
164
.fi
165
.
166
.IP "" 0
167

    
168
.
169
.IP "\(bu" 4
170
release \fIrange|vmid_list\fR Releases a VM on hold\. See \'onevm hold\'
171
.
172
.IP "" 4
173
.
174
.nf
175

    
176
States: HOLD
177
valid options: schedule
178
.
179
.fi
180
.
181
.IP "" 0
182

    
183
.
184
.IP "\(bu" 4
185
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\.
186
.
187
.IP "" 4
188
.
189
.nf
190

    
191
States: ANY
192
valid options: type, snapshot
193
.
194
.fi
195
.
196
.IP "" 0
197

    
198
.
199
.IP "\(bu" 4
200
shutdown \fIrange|vmid_list\fR Shuts down the given VM\. The VM life cycle will end\.
201
.
202
.IP "" 4
203
.
204
.nf
205

    
206
With \-\-hard it unplugs the VM\.
207

    
208
States: RUNNING, UNKNOWN (with \-\-hard)
209
valid options: schedule, hard
210
.
211
.fi
212
.
213
.IP "" 0
214

    
215
.
216
.IP "\(bu" 4
217
undeploy \fIrange|vmid_list\fR Shuts down the given VM\. The VM is saved in the system Datastore\.
218
.
219
.IP "" 4
220
.
221
.nf
222

    
223
With \-\-hard it unplugs the VM\.
224

    
225
States: RUNNING
226
valid options: schedule, hard
227
.
228
.fi
229
.
230
.IP "" 0
231

    
232
.
233
.IP "\(bu" 4
234
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\.
235
.
236
.IP "" 4
237
.
238
.nf
239

    
240
States: RUNNING
241
valid options: schedule, hard
242
.
243
.fi
244
.
245
.IP "" 0
246

    
247
.
248
.IP "\(bu" 4
249
reboot \fIrange|vmid_list\fR Reboots the given VM, this is equivalent to execute the reboot command from the VM console\.
250
.
251
.IP "" 4
252
.
253
.nf
254

    
255
The VM will be ungracefully rebooted if \-\-hard is used\.
256

    
257
States: RUNNING
258
valid options: schedule, hard
259
.
260
.fi
261
.
262
.IP "" 0
263

    
264
.
265
.IP "\(bu" 4
266
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
267
.
268
.IP "" 4
269
.
270
.nf
271

    
272
States: PENDING, HOLD, STOPPED, UNDEPLOYED
273
valid options: enforce
274
.
275
.fi
276
.
277
.IP "" 0
278

    
279
.
280
.IP "\(bu" 4
281
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\.
282
.
283
.IP "" 4
284
.
285
.nf
286

    
287
States: RUNNING
288
valid options: enforce, live
289
.
290
.fi
291
.
292
.IP "" 0
293

    
294
.
295
.IP "\(bu" 4
296
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
297
.
298
.IP "" 4
299
.
300
.nf
301

    
302
States: RUNNING
303
valid options: schedule
304
.
305
.fi
306
.
307
.IP "" 0
308

    
309
.
310
.IP "\(bu" 4
311
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)\.
312
.
313
.IP "" 4
314
.
315
.nf
316

    
317
States: RUNNING
318
valid options: schedule
319
.
320
.fi
321
.
322
.IP "" 0
323

    
324
.
325
.IP "\(bu" 4
326
resume \fIrange|vmid_list\fR Resumes the execution of the a saved VM
327
.
328
.IP "" 4
329
.
330
.nf
331

    
332
States: STOPPED, SUSPENDED, UNDEPLOYED, POWEROFF, UNKNOWN
333
valid options: schedule
334
.
335
.fi
336
.
337
.IP "" 0
338

    
339
.
340
.IP "\(bu" 4
341
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\.
342
.
343
.IP "" 4
344
.
345
.nf
346

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

    
351
States for success/failure recovers: Any ACTIVE state\.
352
States for a retry recover: Any *FAILURE state
353
valid options: success, failure, retry, interactive
354
.
355
.fi
356
.
357
.IP "" 0
358

    
359
.
360
.IP "\(bu" 4
361
disk\-attach \fIvmid\fR Attaches a disk to a running VM\. When using \-\-file add only one DISK instance\.
362
.
363
.IP "" 4
364
.
365
.nf
366

    
367
States: RUNNING, POWEROFF
368
valid options: file, image, target, cache, discard, prefix
369
.
370
.fi
371
.
372
.IP "" 0
373

    
374
.
375
.IP "\(bu" 4
376
disk\-detach \fIvmid\fR \fIdiskid\fR Detaches a disk from a running VM
377
.
378
.IP "" 4
379
.
380
.nf
381

    
382
States: RUNNING, POWEROFF
383
.
384
.fi
385
.
386
.IP "" 0
387

    
388
.
389
.IP "\(bu" 4
390
nic\-attach \fIvmid\fR Attaches a NIC to a running VM\. When using \-\-file add only one NIC instance\.
391
.
392
.IP "" 4
393
.
394
.nf
395

    
396
States: RUNNING, POWEROFF
397
valid options: file, network, ip
398
.
399
.fi
400
.
401
.IP "" 0
402

    
403
.
404
.IP "\(bu" 4
405
nic\-detach \fIvmid\fR \fInicid\fR Detaches a NIC from a running VM
406
.
407
.IP "" 4
408
.
409
.nf
410

    
411
States: RUNNING, POWEROFF
412
.
413
.fi
414
.
415
.IP "" 0
416

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

    
434
States: RUNNING
435
.
436
.fi
437
.
438
.IP "" 0
439

    
440
.
441
.IP "\(bu" 4
442
unresched \fIrange|vmid_list\fR Clears the rescheduling flag for the VM\.
443
.
444
.IP "" 4
445
.
446
.nf
447

    
448
States: RUNNING
449
.
450
.fi
451
.
452
.IP "" 0
453

    
454
.
455
.IP "\(bu" 4
456
rename \fIvmid\fR \fIname\fR Renames the VM
457
.
458
.IP "\(bu" 4
459
snapshot\-create \fIrange|vmid_list\fR [\fIname\fR] Creates a new VM snapshot valid options: schedule
460
.
461
.IP "\(bu" 4
462
snapshot\-revert \fIvmid\fR \fIsnapshot_id\fR Reverts a VM to a saved snapshot
463
.
464
.IP "\(bu" 4
465
snapshot\-delete \fIvmid\fR \fIsnapshot_id\fR Delets a snapshot of a VM
466
.
467
.IP "\(bu" 4
468
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\.
469
.
470
.IP "" 4
471
.
472
.nf
473

    
474
States: POWEROFF
475
.
476
.fi
477
.
478
.IP "" 0
479

    
480
.
481
.IP "\(bu" 4
482
disk\-snapshot\-revert \fIvmid\fR \fIdiskid\fR \fIsnapshot_id\fR Reverts disk state to a previously taken snapshot\.
483
.
484
.IP "" 4
485
.
486
.nf
487

    
488
States: POWEROFF
489
.
490
.fi
491
.
492
.IP "" 0
493

    
494
.
495
.IP "\(bu" 4
496
disk\-snapshot\-delete \fIvmid\fR \fIdiskid\fR \fIsnapshot_id\fR Deletes a disk snapshot\.
497
.
498
.IP "" 4
499
.
500
.nf
501

    
502
States: POWEROFF
503
.
504
.fi
505
.
506
.IP "" 0
507

    
508
.
509
.IP "\(bu" 4
510
list [\fIfilterflag\fR] Lists VMs in the pool valid options: list, delay, filter, csv, xml, numeric, kilobytes, describe
511
.
512
.IP "\(bu" 4
513
show \fIvmid\fR Shows information for the given VM valid options: xml, all
514
.
515
.IP "\(bu" 4
516
top [\fIfilterflag\fR] Lists Images continuously valid options: list, delay, filter, csv, xml, numeric, kilobytes
517
.
518
.IP "\(bu" 4
519
resize \fIvmid\fR Resizes the capacity of a Virtual Machine (offline, the VM cannot be RUNNING) valid options: cpu, vcpu, memory, enforce, file
520
.
521
.IP "\(bu" 4
522
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
523
.
524
.IP "" 4
525
.
526
.nf
527

    
528
States: POWEROFF
529
.
530
.fi
531
.
532
.IP "" 0
533

    
534
.
535
.IP "" 0
536
.
537
.SH "ARGUMENT FORMATS"
538
.
539
.IP "\(bu" 4
540
file Path to a file
541
.
542
.IP "\(bu" 4
543
range List of id\'s in the form 1,8\.\.15
544
.
545
.IP "\(bu" 4
546
text String
547
.
548
.IP "\(bu" 4
549
hostid OpenNebula HOST name or id
550
.
551
.IP "\(bu" 4
552
groupid OpenNebula GROUP name or id
553
.
554
.IP "\(bu" 4
555
userid OpenNebula USER name or id
556
.
557
.IP "\(bu" 4
558
datastoreid OpenNebula DATASTORE name or id
559
.
560
.IP "\(bu" 4
561
vmid OpenNebula VM name or id
562
.
563
.IP "\(bu" 4
564
vmid_list Comma\-separated list of OpenNebula VM names or ids
565
.
566
.IP "\(bu" 4
567
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 uid VM of the user identified by this uid user VM of the user identified by the username
568
.
569
.IP "\(bu" 4
570
diskid Integer
571
.
572
.IP "" 0
573
.
574
.SH "LICENSE"
575
OpenNebula 4\.13\.80 Copyright 2002\-2015, OpenNebula Project (OpenNebula\.org), C12G Labs
576
.
577
.P
578
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