Skip to content

Commit 9b1a6cb

Browse files
authored
M #-: Add the Warning about history records indexes and modify an example accordingly (#3271)
Signed-off-by: Mikalai Kutouski <[email protected]>
1 parent a7161a2 commit 9b1a6cb

File tree

1 file changed

+11
-2
lines changed
  • source/installation_and_configuration/opennebula_services

1 file changed

+11
-2
lines changed

source/installation_and_configuration/opennebula_services/database.rst

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,20 @@ onedb change history
143143

144144
Change the CLUSTER_ID of a previous VM sequence in a non interactive way. This is useful when accidentally deleting a cluster. You might be unable to attach disks or NICs to the VM due to the VM being reported in a non existing cluster.
145145

146-
The following command changes the the sequence 0 of the VM 224 to have the CLUSTER_ID set to 0.
146+
.. warning::
147+
148+
When dealing with history records one needs to take into account that the oldest index of the history records equals 0 whereas the latest one has the largest index. So in order to modify the latest history record one needs to get the largest index first, e.g. with help of the following command:
149+
150+
.. prompt:: text $ auto
151+
152+
$ onevm show -j <vm_id>| jq -r '.VM.HISTORY_RECORDS.HISTORY[-1].SEQ'
153+
154+
155+
The following command changes the sequence 10 (let's assume it's the latest history record for that example) of the VM 224 to have the CLUSTER_ID set to 0.
147156

148157
.. prompt:: text $ auto
149158

150-
$ onedb change-history --id 224 --seq 0 '/HISTORY/CID' 0
159+
$ onedb change-history --id 224 --seq 10 '/HISTORY/CID' 0
151160

152161
.. _onedb_update_history:
153162

0 commit comments

Comments
 (0)