Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
vmware [2024/09/29 00:05] jango |
vmware [2024/12/25 10:45] (aktuell) jango [Powershell] |
||
---|---|---|---|
Zeile 217: | Zeile 217: | ||
=====Powershell===== | =====Powershell===== | ||
- | 1. Connecting to vSphere or ESXi | + | <code powershell> |
- | Before running any VMware PowerCLI | + | Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass |
+ | Install-Module -Name VMware.PowerCLI | ||
+ | Import-Module VMware.PowerCLI | ||
+ | </ | ||
+ | Connecting to vSphere or ESXi | ||
< | < | ||
- | Example: < | ||
- | |||
- | 2. Getting Information about VMs | ||
- | Retrieve detailed information about your virtual machines. | ||
- | |||
Get all VMs: | Get all VMs: | ||
< | < | ||
Zeile 234: | Zeile 233: | ||
Get VM’s resource allocation (CPU, Memory, etc.): | Get VM’s resource allocation (CPU, Memory, etc.): | ||
< | < | ||
- | 3. Managing VMs | + | |
+ | ====Managing VMs==== | ||
Start a VM: | Start a VM: | ||
< | < | ||
Zeile 243: | Zeile 244: | ||
Restart a VM: | Restart a VM: | ||
< | < | ||
- | 4. Cloning a VM | + | |
+ | ====Cloning a VM==== | ||
Clone a virtual machine to create a new one: | Clone a virtual machine to create a new one: | ||
< | < | ||
- | 5. Snapshot Management | + | |
- | Snapshots are useful for saving the state of a VM. You can create, revert, or remove snapshots. | + | ====Snapshot Management==== |
Create a snapshot: | Create a snapshot: | ||
Zeile 258: | Zeile 261: | ||
Remove a snapshot: | Remove a snapshot: | ||
< | < | ||
- | 6. Managing ESXi Hosts | + | |
+ | ====Managing ESXi Hosts==== | ||
Get ESXi host information: | Get ESXi host information: | ||
< | < | ||
Zeile 267: | Zeile 271: | ||
Exit maintenance mode: | Exit maintenance mode: | ||
< | < | ||
- | 7. Managing Datastores | + | |
+ | ====Managing Datastores==== | ||
Get all datastores: | Get all datastores: | ||
< | < | ||
Zeile 274: | Zeile 279: | ||
Rescan datastores on ESXi: | Rescan datastores on ESXi: | ||
< | < | ||
- | 8. Network Management | + | |
+ | ====Network Management==== | ||
Get all network adapters (NICs): | Get all network adapters (NICs): | ||
- | < | + | < |
Get all vSwitches: | Get all vSwitches: | ||
< | < | ||
Zeile 283: | Zeile 289: | ||
Create a port group: | Create a port group: | ||
< | < | ||
- | 9. Managing vCenter Clusters | + | |
+ | ====Managing vCenter Clusters==== | ||
Get all clusters: | Get all clusters: | ||
< | < | ||
Get information about a specific cluster: | Get information about a specific cluster: | ||
< | < | ||
- | 10. VM Affinity Rules | + | |
+ | ====VM Affinity Rules==== | ||
Create and manage affinity or anti-affinity rules to control how VMs are placed in the cluster. | Create and manage affinity or anti-affinity rules to control how VMs are placed in the cluster. | ||
Create VM-Host affinity rule: | Create VM-Host affinity rule: | ||
< | < | ||
- | 11. Logging Out from vSphere or ESXi | + | |
+ | ====Logging Out from vSphere or ESXi==== | ||
After your automation tasks are done, you can disconnect from the server: | After your automation tasks are done, you can disconnect from the server: | ||