Commit 7dab9e2
committed
VM ingestion feature allows CloudStack to discover, on-board, import existing VMs in an infra. The feature currently works only for VMware, with a hypervisor agnostic framework which may be extended for KVM and XenServer in future.
Two new APIs have been added, listUnmanagedInstances and importUnmanagedInstance.
listUnmanagedInstances
API will list all unmanaged virtual machine for a give cluster. Optionally, name for an existing unmanaged virtual machine can be given to retrieve VM details.
API request params -
clusterid(UUID of cluster)
name(instance name)
Response -
clusterid
hostid
name
osdisplayname
memory
powerstate
cpuCoresPerSocket
cpunumber
cpuspeed
disk
- id
- capacity
- controller
- controllerunit
- imagepath
- position
nic
- id
- macaddress
- networkname
- vlanid
- pcislot
- ipaddress(Only with VMware Tools installed on VM for VMware)
importUnmanagedInstance
API will import an exisitng unmanaged virtual machine into CloudStack for a given cluster and virtual machine name. Service offering for the VM, disk offerings for volumes and networks for NICs of the VM can be mapped. Some optional parameters like projectid, domainid, hostname, details, etc can also be given. Appropritate networks, service offering and disk offerings need to be present before import and cannot be created on the fly during the API call.
API request params -
clusterid(UUID of cluster)
name(instance name)
displayname
hostname
domainid
projectid
templateid
serviceofferingid
diskofferingid(UUID of disk offering for root disk)
nicnetworklist(Map for NIC ID and corresponding Network UUID)
nicipaddresslist(Map for NIC ID and corresponding IP address)
datadiskofferinglist(Map for disk ID and corresponding disk offering UUID)
details(Map for VM details)
migrateAllowed(VM and its volumes are allowed to migrate to different host/pool when offerings passed are incompatible with current host/pool)
Response -
Same response as that of deployVirtualMachine API
A python 3 based script (scripts/vm/hypervisor/vmware/discover_networks.py) has been created to aid migrations. It leverages VMware’s pyvmomi library (https://github.com/vmware/pyvmomi) and allows listing all networks for a vCenter host or cluster.
This script can take following arguments,
-h, --help show this help message and exit
-s HOST, --host HOST vSpehre service to connect to
-o PORT, --port PORT Port to connect on
-u USER, --user USER User name to use
-p PASSWORD, --password PASSWORD Password to use
-c CLUSTER, --cluster CLUSTER Cluster for which discover networks
-S, --disable_ssl_verification Disable ssl host certificate verification
-d, --debug Debug log messages
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>1 parent 666ec69 commit 7dab9e2
File tree
28 files changed
+3110
-283
lines changed- api/src/main/java
- com/cloud
- event
- vm
- org/apache/cloudstack
- api
- command/admin/vm
- response
- vm
- core/src/main/java/com/cloud/agent/api
- engine
- api/src/main/java/org/apache/cloudstack/engine/orchestration/service
- orchestration/src/main/java/org/apache/cloudstack/engine/orchestration
- plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource
- scripts/vm/hypervisor/vmware
- server/src
- main
- java
- com/cloud/vm
- org/apache/cloudstack/vm
- resources/META-INF/cloudstack/server-compute
- test/java
- com/cloud/vpc
- org/apache/cloudstack/vm
- tools/apidoc
- vmware-base/src/main/java/com/cloud/hypervisor/vmware/mo
28 files changed
+3110
-283
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
22 | 29 | | |
23 | 30 | | |
24 | 31 | | |
| |||
69 | 76 | | |
70 | 77 | | |
71 | 78 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
| |||
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
| 100 | + | |
99 | 101 | | |
100 | 102 | | |
101 | 103 | | |
| |||
594 | 596 | | |
595 | 597 | | |
596 | 598 | | |
| 599 | + | |
597 | 600 | | |
598 | 601 | | |
599 | 602 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
513 | 513 | | |
514 | 514 | | |
515 | 515 | | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
516 | 520 | | |
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| 54 | + | |
| 55 | + | |
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
| |||
69 | 72 | | |
70 | 73 | | |
71 | 74 | | |
| 75 | + | |
72 | 76 | | |
73 | 77 | | |
74 | 78 | | |
| |||
90 | 94 | | |
91 | 95 | | |
92 | 96 | | |
| 97 | + | |
93 | 98 | | |
94 | 99 | | |
95 | 100 | | |
| |||
169 | 174 | | |
170 | 175 | | |
171 | 176 | | |
| 177 | + | |
172 | 178 | | |
173 | 179 | | |
174 | 180 | | |
| |||
222 | 228 | | |
223 | 229 | | |
224 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
225 | 234 | | |
226 | 235 | | |
227 | 236 | | |
| |||
253 | 262 | | |
254 | 263 | | |
255 | 264 | | |
| 265 | + | |
256 | 266 | | |
257 | 267 | | |
258 | 268 | | |
| |||
526 | 536 | | |
527 | 537 | | |
528 | 538 | | |
| 539 | + | |
529 | 540 | | |
530 | 541 | | |
531 | 542 | | |
| |||
0 commit comments