Statistics
| Branch: | Tag: | Revision:

one / share / man / onedb.1 @ 05241124

History | View | Annotate | Download (5.1 KB)

1
.\" generated with Ronn/v0.7.3
2
.\" http://github.com/rtomayko/ronn/tree/0.7.3
3
.
4
.TH "ONEDB" "1" "July 2017" "" "onedb(1) -- OpenNebula database migration tool"
5
.
6
.SH "NAME"
7
\fBonedb\fR \- OpenNebula database migration tool
8
.
9
.P
10
This command enables the user to manage the OpenNebula database\. It provides information about the DB version, means to upgrade it to the latest version, and backup tools\.
11
.
12
.SH "OPTIONS"
13
.
14
.nf
15

    
16
 \-f, \-\-force               Forces the backup even if the DB exists
17
 \-\-federated               Limit backup/restore to federated tables
18
 \-b, \-\-backup file         Use this file to store SQL dump
19
 \-\-slave\-server host       Slave MySQL server hostname or IP\. Defaults to
20
                           localhost
21
 \-\-slave\-port port         Slave MySQL server port\. Defaults to 3306
22
 \-\-slave\-username user     Slave MySQL username
23
 \-\-slave\-password pass     Slave MySQL password\. Leave unset to be prompted
24
                           for it
25
 \-\-slave\-dbname dbname     Slave MySQL DB name for OpenNebula
26
 \-\-slave\-backup file       Use this file to store SQL dump
27
 \-\-extra arg               Extra args
28
 \-s, \-\-start TIME          First time to process
29
 \-e, \-\-end TIME            Last time to process
30
 \-i, \-\-id ID               Filter by ID
31
 \-x, \-\-xpath ID            Filter by xpath
32
 \-e, \-\-expr ID             Filter by expression (UNAME=oneadmin)
33
 \-\-dry                     Do not write in the database, output xml
34
 \-d, \-\-delete              Delete all matched xpaths
35
 \-v, \-\-verbose             Verbose mode
36
 \-h, \-\-help                Show this message
37
 \-V, \-\-version             Show version and copyright information
38
 \-s, \-\-sqlite file         SQLite DB file
39
 \-S, \-\-server host         MySQL server hostname or IP\. Defaults to
40
                           localhost
41
 \-P, \-\-port port           MySQL server port\. Defaults to 3306
42
 \-u, \-\-username user       MySQL username
43
 \-p, \-\-password pass       MySQL password\. Leave unset to be prompted for it
44
 \-d, \-\-dbname dbname       MySQL DB name for OpenNebula
45
.
46
.fi
47
.
48
.SH "COMMANDS"
49
.
50
.IP "\(bu" 4
51
backup [\fIoutput_file\fR] Dumps the DB to a file specified in the argument valid options: force, federated
52
.
53
.IP "\(bu" 4
54
version Prints the current DB version\. Use \-v flag to see also OpenNebula version
55
.
56
.IP "\(bu" 4
57
history Prints the upgrades history
58
.
59
.IP "\(bu" 4
60
restore [\fIbackup_file\fR] Restores the DB from a backup file\. Only restores backups generated from the same backend (SQLite or MySQL) valid options: force, federated
61
.
62
.IP "\(bu" 4
63
upgrade [\fIversion\fR] Upgrades the DB to the latest version where \fIversion\fR : DB version (e\.g\. 1, 3) to upgrade\. By default the DB is upgraded to the latest version valid options: force, backup
64
.
65
.IP "\(bu" 4
66
fsck Checks the consistency of the DB, and fixes the problems found valid options: force, backup
67
.
68
.IP "\(bu" 4
69
import\-slave Imports an existing federation slave into the federation master database valid options: force, backup, slave\-server, slave\-port, slave\-username, slave\-password, slave\-dbname, slave\-backup
70
.
71
.IP "\(bu" 4
72
vcenter\-one54 Migrate VM and templates so they can be used by OpenNebula 5\.4 valid options: force, backup
73
.
74
.IP "\(bu" 4
75
patch \fIfile\fR Applies a database patch file valid options: backup, extra
76
.
77
.IP "\(bu" 4
78
sqlite2mysql Migrates a SQLite OpenNebula Database to MySQL valid options: backup
79
.
80
.IP "\(bu" 4
81
purge\-history Deletes all but the last history records from non DONE VMs
82
.
83
.IP "" 4
84
.
85
.nf
86

    
87
**WARNING**: This action is done while OpenNebula is running\. Make
88
a backup of the datasbase before executing\.
89
valid options: start_time, end_time
90
.
91
.fi
92
.
93
.IP "" 0
94

    
95
.
96
.IP "\(bu" 4
97
purge\-done Deletes all VMs in DONE state
98
.
99
.IP "" 4
100
.
101
.nf
102

    
103
**WARNING**: This action is done while OpenNebula is running\. Make
104
a backup of the datasbase before executing\.
105
valid options: start_time, end_time
106
.
107
.fi
108
.
109
.IP "" 0
110

    
111
.
112
.IP "\(bu" 4
113
change\-body
114
.
115
.IP "" 4
116
.
117
.nf
118

    
119
You can filter the objects to modify using one of these options:
120

    
121
    * \-\-id: object id, example: 156
122
    * \-\-xpath: xpath expression, example: TEMPLATE[count(NIC)>1]
123
    * \-\-expr: xpath expression, can use operators =, !=, <, >, <= or >=
124
        examples: UNAME=oneadmin, TEMPLATE/NIC/NIC_ID>0
125

    
126
If you want to change a value use a third parameter\. In case you want
127
to delete it use \-\-delete option\.
128

    
129
Change the second network of VMs that belong to "user":
130

    
131
    onedb change\-body vm \-\-expr UNAME=user \e
132
        \'/VM/TEMPLATE/NIC[NETWORK="service"]/NETWORK\' new_network
133

    
134
Delete cache attribute in all disks, write xml, do not modify DB:
135

    
136
    onedb change\-body vm \'/VM/TEMPLATE/DISK/CACHE\' \-\-delete \-\-dry
137

    
138
Delete cache attribute in all disks in poweroff:
139

    
140
    onedb change\-body vm \-\-expr LCM_STATE=8 \e
141
        \'/VM/TEMPLATE/DISK/CACHE\' \-\-delete
142

    
143
**WARNING**: This action is done while OpenNebula is running\. Make
144
a backup of the datasbase before executing\.
145
valid options: id, xpath, expr, dry, delete
146
.
147
.fi
148
.
149
.IP "" 0
150

    
151
.
152
.IP "" 0
153
.
154
.SH "ARGUMENT FORMATS"
155
.
156
.IP "\(bu" 4
157
file Path to a file
158
.
159
.IP "\(bu" 4
160
range List of id\'s in the form 1,8\.\.15
161
.
162
.IP "\(bu" 4
163
text String
164
.
165
.IP "" 0
166