Skip to content

Commit 8532e8d

Browse files
Unmanage VMs documentation (apache#139)
* Unmanage VMs documentation * Apply suggestions from code review Co-authored-by: Andrija Panic <45762285+andrijapanicsb@users.noreply.github.com> * Update VM ingestion docs * Refactor forced param description Co-authored-by: Andrija Panic <45762285+andrijapanicsb@users.noreply.github.com>
1 parent 2c3a9e5 commit 8532e8d

File tree

3 files changed

+90
-17
lines changed

3 files changed

+90
-17
lines changed

source/adminguide/virtual_machines.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -913,6 +913,11 @@ snapshot:
913913
VM snapshots are deleted automatically when a VM is destroyed. You don't
914914
have to manually delete the snapshots in this case.
915915

916+
Unmanaging Virtual Machines
917+
===========================
918+
919+
.. include:: virtual_machines/unmanage_vms.rst
920+
916921

917922
Importing Virtual Machines
918923
===========================

source/adminguide/virtual_machines/VM_Ingestion.rst

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,6 @@
1313
specific language governing permissions and limitations
1414
under the License.
1515
16-
About Importing VMs
17-
--------------------
18-
19-
Unmanaged Virtual Machines
20-
~~~~~~~~~~~~~~~~~~~~~~~~~~
21-
22-
As of ACS 4.14, CloudStack has the concept of **unmanaged** virtual machines. These are virtual machines that are on CloudStack
23-
managed hosts, but that are not in CloudStack's database and therefore CloudStack cannot control (manage) then in any way. Previously,
24-
such VMs could exist, but CloudStack did not 'see' them (their existence *would* be reported in logs as unrecognised VMs).
25-
26-
From ACS 4.14 onwards, CloudStack is able to list these VMs via the listUnmanagedInstances API command and then import (also known as ingest)
27-
those unmanaged VMs via the importUnmanagedInstance API so that they become CloudStack managed guest instances
28-
29-
.. note:: This is currently only available for **vSphere** clusters.
30-
31-
3216
Use Cases and General Usage
3317
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3418

@@ -123,12 +107,14 @@ importUnmanagedInstance API
123107
- **projectid**
124108
- **templateid**
125109
- **serviceofferingid**
126-
- **diskofferingid** (UUID of disk offering for root disk)
127110
- **nicnetworklist** (Map for NIC ID and corresponding Network UUID)
128111
- **nicipaddresslist** (Map for NIC ID and corresponding IP address)
129112
- **datadiskofferinglist** (Map for data disk ID and corresponding disk offering UUID)
130113
- **details** (Map for VM details)
131114
- **migrateallowed** (VM and its volumes are allowed to migrate to different host/storage pool when offering tags conflict with host/storage pool)
115+
- **forced** (If true, a VM is imported despite some of its NIC's MAC addresses being already present)
116+
117+
.. note:: The `forced` parameter is false by default and prevents importing a VM which has a NIC containing a MAC address that has been previously assigned by CloudStack. If it is set to true, the NICs with MAC addresses which already exist in the CloudStack database have the existing MAC addresses reassigned to its NICs.
132118

133119
**Response**:
134120

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
About Unmanaged Virtual Machines
2+
--------------------------------
3+
4+
As of ACS 4.14, CloudStack has the concept of **unmanaged** virtual machines. These are virtual machines that are on CloudStack
5+
managed hosts, but that are not in CloudStack's database and therefore CloudStack cannot control (manage) then in any way. Previously,
6+
such VMs could exist, but CloudStack did not 'see' them (their existence *would* be reported in logs as unrecognised VMs).
7+
8+
From ACS 4.14 onwards, CloudStack is able to list these VMs via the listUnmanagedInstances API command and then import (also known as ingest)
9+
those unmanaged VMs via the importUnmanagedInstance API so that they become CloudStack managed guest instances
10+
11+
From ACS 4.15 onwards, administrators are able to unmanage guest virtual machines.
12+
13+
.. note:: This is currently only available for **vSphere** clusters.
14+
15+
Unmanaging Virtual Machines via API
16+
-----------------------------------
17+
18+
Administrators are able to unmanage guest virtual machines from CloudStack. Once unmanaged, CloudStack can no longer monitor, control or administer the provisioning and orchestration related operations on a virtual machine.
19+
20+
To unmanage a guest virtual machine, an administrator must invoke the unmanageVirtualMachine API passing the ID of the virtual machine to unmanage. The API has the following preconditions:
21+
22+
- The virtual machine must not be destroyed
23+
- The virtual machine state must be 'Running’ or ‘Stopped’
24+
- The virtual machine must be a VMware virtual machine
25+
26+
The API execution will perform the following pre-checks, failing if they are not met:
27+
28+
- There are no volume snapshots associated with any of the virtual machine volumes
29+
- There is no ISO attached to the virtual machine
30+
31+
.. note:: This is currently only available for **vSphere** clusters.
32+
33+
34+
Preserving unmanaged virtual machine NICs
35+
-----------------------------------------
36+
37+
The zone setting: unmanage.vm.preserve.nics can be used to preserve virtual machine NICs and its MAC addresses after unmanaging them. If set to true, the virtual machine NICs (and their MAC addresses) are preserved when unmanaging it. Otherwise, NICs are removed and MAC addresses can be reassigned.
38+
39+
40+
Unmanaging virtual machine actions
41+
----------------------------------
42+
43+
- Clean up virtual machine NICs and deallocate network resources used such as IP addresses and DHCP entries on virtual routers.
44+
45+
- If ‘unmanage.vm.preserve.nics’ = ‘false’ then the NICs are deallocated and removed from CloudStack
46+
47+
- If ‘unmanage.vm.preserve.nics’ = ‘true’ then the NICs remain allocated and are not removed from the database. The NIC’s MAC addresses remain preserved and therefore cannot be assigned to any new NIC.
48+
49+
- Clean up virtual machine volumes in the CloudStack database
50+
51+
- Clean up virtual machine snapshots in the CloudStack database (if any)
52+
- Revoke host access to any managed volumes attached to the VM (applicable to managed storage only)
53+
54+
- Clean up the virtual machine from the following:
55+
56+
- Remove the virtual machine from security groups (if any)
57+
58+
- Remove the virtual machine from instance groups (if any)
59+
60+
- Remove firewall rules for the virtual machine (if any)
61+
62+
- Remove port forwarding rules for the virtual machine (if any)
63+
64+
- Remove load balancing rules for the virtual machine (if any)
65+
66+
- Disable static NAT (if the virtual machine is assigned to it)
67+
68+
- Remove the virtual machine from affinity groups (if any)
69+
70+
- Remove VM details from the CloudStack database
71+
72+
- Decrement the account resources count for volumes and virtual machines
73+
74+
- Generate usage events:
75+
76+
- For volumes destroyed, with type: ‘VOLUME.DELETE’
77+
78+
- For virtual machine snapshots destroyed (if any), with type: ‘VMSNAPSHOT.DELETE’ and 'VMSNAPSHOT.OFF_PRIMARY'
79+
80+
- For virtual machine NICs destroyed: with type: ‘NETWORK.OFFERING.REMOVE’
81+
82+
- For the virtual machine being unmanaged: stopped and destroyed usage events (similar to the generated usage events when expunging a virtual machine), with types: ‘VM.STOP’ and ‘VM.DESTROY', unless the VM has been already stopped before being unmanaged and in this case only ‘VM.DESTROY' is generated.

0 commit comments

Comments
 (0)