summaryrefslogtreecommitdiff
path: root/2 Areas/Werk/VPS platform/VM cannot be rescued.md
blob: 934da0fe58009b8a6daa5f10059dafa2e8ff22ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
---
tags:
  - rescue
  - groupvps
---
## Error cause
`{'code': 400, 'created': '2025-02-10T10:38:39Z', 'message': 'Instance 44240d84-52ca-4474-b4ac-163bd1ba2def cannot be rescued: Driver Error: Image 9115b741-6eb3-4574-894d-9f2e28600ff8 could not be found.'}`

Likely a deleted snapshot!
## Show BDM in DB
```
MariaDB [nova]> select image_id from block_device_mapping where instance_uuid = "44240d84-52ca-4474-b4ac-163bd1ba2def";
+--------------------------------------+
| image_id                             |
+--------------------------------------+
| 9115b741-6eb3-4574-894d-9f2e28600ff8 |
+--------------------------------------+
1 row in set (0.000 sec)
```

## Find base image
```
MariaDB [glance]> select * from image_properties where image_id = "9115b741-6eb3-4574-894d-9f2e28600ff8" and name = "base_image_ref" \G
*************************** 1. row ***************************
        id: 24353
  image_id: 9115b741-6eb3-4574-894d-9f2e28600ff8
      name: base_image_ref
     value: a689d899-903d-49be-96ab-6ac638bbc5fd
created_at: 2024-07-20 11:09:34
updated_at: 2024-08-04 14:45:12
deleted_at: 2024-08-04 14:45:12
   deleted: 1
1 row in set (0.000 sec)
```
... repeat until its base image is not snapshot.

## Update references
```
MariaDB [nova]> select image_ref from instances where uuid = "44240d84-52ca-4474-b4ac-163bd1ba2def";
+--------------------------------------+
| image_ref                            |
+--------------------------------------+
| a689d899-903d-49be-96ab-6ac638bbc5fd |
+--------------------------------------+
1 row in set (0.000 sec)

MariaDB [nova]> select image_id from block_device_mapping where instance_uuid = "44240d84-52ca-4474-b4ac-163bd1ba2def";
+--------------------------------------+
| image_id                             |
+--------------------------------------+
| a689d899-903d-49be-96ab-6ac638bbc5fd |
+--------------------------------------+
1 row in set (0.000 sec)

update instance_system_metadata set value = "a689d899-903d-49be-96ab-6ac638bbc5fd" where instance_uuid = "44240d84-52ca-4474-b4ac-163bd1ba2def" and `key` = "image_base_image_ref";
```

## Notes on specific case
44240d84-52ca-4474-b4ac-163bd1ba2def instance_system_metadata geupdate maar alleen het image_base_image_ref geupdatet.
De rest van de image metadata is nog alsof het het oude snapshot.
Misschien kunnen we nova-manage gebruiken om het te updaten:
```
[jasras@n07.compute.prv.vps1-testpod-cph3.one.com ~]$ sudo nova-manage image_property set --help
Modules with known eventlet monkey patching issues were imported prior to eventlet monkey patching: urllib3. This warning can usually be ignored if the caller is only importing and not executing nova code.
usage: nova-manage image_property set [-h] [--property <image_property>] <instance_uuid>

Set the values of instance image properties stored in the database. This is only allowed for instances with a STOPPED, SHELVED or SHELVED_OFFLOADED vm_state.

positional arguments:
  <instance_uuid>       UUID of the instance

options:
  -h, --help            show this help message and exit
  --property <image_property>
                        Image property to set using the format name=value. For example: --property hw_disk_bus=virtio --property hw_cdrom_bus=sata

```