Statistics
| Branch: | Tag: | Revision:

one / share / man / onedb.1 @ 27e61bae

History | View | Annotate | Download (4.41 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
 \-\-extra arg               Extra args
20
 \-s, \-\-start TIME          First time to process
21
 \-e, \-\-end TIME            Last time to process
22
 \-i, \-\-id ID               Filter by ID
23
 \-x, \-\-xpath ID            Filter by xpath
24
 \-e, \-\-expr ID             Filter by expression (UNAME=oneadmin)
25
 \-\-dry                     Do not write in the database, output xml
26
 \-d, \-\-delete              Delete all matched xpaths
27
 \-v, \-\-verbose             Verbose mode
28
 \-h, \-\-help                Show this message
29
 \-V, \-\-version             Show version and copyright information
30
 \-s, \-\-sqlite file         SQLite DB file
31
 \-S, \-\-server host         MySQL server hostname or IP\. Defaults to
32
                           localhost
33
 \-P, \-\-port port           MySQL server port\. Defaults to 3306
34
 \-u, \-\-username user       MySQL username
35
 \-p, \-\-password pass       MySQL password\. Leave unset to be prompted for it
36
 \-d, \-\-dbname dbname       MySQL DB name for OpenNebula
37
.
38
.fi
39
.
40
.SH "COMMANDS"
41
.
42
.IP "\(bu" 4
43
backup [\fIoutput_file\fR] Dumps the DB to a file specified in the argument valid options: force, federated
44
.
45
.IP "\(bu" 4
46
version Prints the current DB version\. Use \-v flag to see also OpenNebula version
47
.
48
.IP "\(bu" 4
49
history Prints the upgrades history
50
.
51
.IP "\(bu" 4
52
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
53
.
54
.IP "\(bu" 4
55
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
56
.
57
.IP "\(bu" 4
58
fsck Checks the consistency of the DB, and fixes the problems found valid options: force, backup
59
.
60
.IP "\(bu" 4
61
vcenter\-one54 Migrate VM and templates so they can be used by OpenNebula 5\.4 valid options: force, backup
62
.
63
.IP "\(bu" 4
64
patch \fIfile\fR Applies a database patch file valid options: backup, extra
65
.
66
.IP "\(bu" 4
67
sqlite2mysql Migrates a SQLite OpenNebula Database to MySQL valid options: backup
68
.
69
.IP "\(bu" 4
70
purge\-history Deletes all but the last history records from non DONE VMs
71
.
72
.IP "" 4
73
.
74
.nf
75

    
76
**WARNING**: This action is done while OpenNebula is running\. Make
77
a backup of the datasbase before executing\.
78
valid options: start_time, end_time
79
.
80
.fi
81
.
82
.IP "" 0
83

    
84
.
85
.IP "\(bu" 4
86
purge\-done Deletes all VMs in DONE state
87
.
88
.IP "" 4
89
.
90
.nf
91

    
92
**WARNING**: This action is done while OpenNebula is running\. Make
93
a backup of the datasbase before executing\.
94
valid options: start_time, end_time
95
.
96
.fi
97
.
98
.IP "" 0
99

    
100
.
101
.IP "\(bu" 4
102
change\-body
103
.
104
.IP "" 4
105
.
106
.nf
107

    
108
You can filter the objects to modify using one of these options:
109

    
110
    * \-\-id: object id, example: 156
111
    * \-\-xpath: xpath expression, example: TEMPLATE[count(NIC)>1]
112
    * \-\-expr: xpath expression, can use operators =, !=, <, >, <= or >=
113
        examples: UNAME=oneadmin, TEMPLATE/NIC/NIC_ID>0
114

    
115
If you want to change a value use a third parameter\. In case you want
116
to delete it use \-\-delete option\.
117

    
118
Change the second network of VMs that belong to "user":
119

    
120
    onedb change\-body vm \-\-expr UNAME=user \e
121
        \'/VM/TEMPLATE/NIC[NETWORK="service"]/NETWORK\' new_network
122

    
123
Delete cache attribute in all disks, write xml, do not modify DB:
124

    
125
    onedb change\-body vm \'/VM/TEMPLATE/DISK/CACHE\' \-\-delete \-\-dry
126

    
127
Delete cache attribute in all disks in poweroff:
128

    
129
    onedb change\-body vm \-\-expr LCM_STATE=8 \e
130
        \'/VM/TEMPLATE/DISK/CACHE\' \-\-delete
131

    
132
**WARNING**: This action is done while OpenNebula is running\. Make
133
a backup of the datasbase before executing\.
134
valid options: id, xpath, expr, dry, delete
135
.
136
.fi
137
.
138
.IP "" 0
139

    
140
.
141
.IP "" 0
142
.
143
.SH "ARGUMENT FORMATS"
144
.
145
.IP "\(bu" 4
146
file Path to a file
147
.
148
.IP "\(bu" 4
149
range List of id\'s in the form 1,8\.\.15
150
.
151
.IP "\(bu" 4
152
text String
153
.
154
.IP "" 0
155