Home Page Icon
Home Page
Table of Contents for
VMware vSphere
Close
VMware vSphere
by Matt Boren, Andrew Sullivan, Brian Graf, Glenn Sizemore, Jonathan Medd, Luc Deke
VMware vSphere PowerCLI Reference
Titlepage
Copyright
Dedication
Acknowledgments
About the Authors
Introduction
Part I: Install, Configure, and Manage the vSphere Environment
Chapter 1: Automating vCenter Server Deployment and Configuration
Prepare the vCenter Installation
Create an Automated Installation
Set Up Your vCenter Server Folder Structure
Define Users and Their Privileges
Configure Datacenters and Clusters
Licensing
Chapter 2: Automating vSphere Hypervisor Deployment and Configuration
Prepare for an Installation
Automate an Installation
Chapter 3: Automating Networking
Chapter 4: Automating Storage
Set Up the Storage
Storage Policies
vSphere APIs for I/O Filtering
VSAN
Part II: Managing the Virtual Machine Life Cycle
Using Advanced vSphere Features
Configure EVC
vFlash Read Cache
Manage DRS Groups
Use Fault Tolerance
Use Distributed Power Management
Configure Host Profiles
Configure Active Directory Integration
Chapter 6: Creating Virtual Machines
Use the New-VM Cmdlet
Perform a Mass Deployment
Maintain VMware Tools
Chapter 7: Using Templates and Customization Specifications
Use Customization Specifications
Use Templates
Chapter 8: Configuring Virtual Machine Hardware
Add, Configure, and Remove Virtual Hardware
Optimize Storage Usage with Thin Provisioning
Chapter 9: Advanced Virtual Machine Features
Interact with the Guest OS
Use vMotion and Storage vMotion
Use and Manage Snapshots
Chapter 10: Using vApps
Import Virtual Appliances
Create Your Own vApps
Maintain vApps
Part III: Securing Your vSphere Environment
Chapter 11: Backing Up and Restoring Your Virtual Machines
Work with Snapshots
Create Do-It-Yourself Backups
Restore Your VMs from a DIY Backup
Change Block Tracking
Provide PowerShell Support for Corporate Backup Applications
Chapter 12: Organize Your Disaster Recovery
Back Up Your vCenter Server Database
Restore Your vCenter Server
Export vCenter Server Inventory Items
Import vCenter Server Inventory Items
Recover Virtual Machines
Chapter 13: Hardening the vSphere Environment
Use the Hardening Guides
Work with the Guidelines
Bring It All Together
Chapter 14: Maintain Security in Your vSphere Environment
Install the vCenter Update Manager PowerCLI Snap-in
Work with Baselines
Work with Upgrades and Patches
Report the Security Status
Applying Patches Without vSphere Update Manager
Part IV: Monitoring and Reporting
Chapter 15: Reporting and Auditing
The Basics
Information Sources
Report Formats
Chapter 16: Using Statistical Data
Understand Some Basic Concepts
Gather Statistical Data
Offload Statistical Data
Chapter 17: Alarms
Determine What to Monitor
Use Alarms
Part V: Integration
Chapter 18: The SDK
Work with the vSphere SDK
Use the vSphere API Reference
Use Managed Objects
Code Parameter Objects
Find the Method You Need
Understand Return Values and Faults
Put Some Tips and Tricks to Good Use
Chapter 19: vCloud Director
Prerequisites
Connecting to vCloud Director
Manage Organizations
Manage Users
Manage vDCs
Manage vApps
Manage VMs
vCloud Director Networks
Search-Cloud
Chapter 20: vCloud Air
Prerequisites
General
vCloud Air Authentication
Set-PowerCLIConfiguration
Open-VMConsoleWindow
Tasks
Get-CIView
Chapter 21: vRealize Orchestrator
Requirements
Running an External Script
Receiving a Return Code from an External Script
Use Cases
Alternative Method to the PowerShell Plug-in
Calling vRO Workflows from PowerShell
Chapter 22: Site Recovery Manager
What Is SRM?
Exploring the SRM Cmdlets
Chapter 23: PowerActions
Requirements
Installation and Initial Configuration
PowerCLI Console
PowerCLI Scripts
Further Use Cases
Final Thoughts
Part VI: PowerCLI and DevOps
Chapter 24: Source Control
File Services
Apache Subversion
GitHub
Chapter 25: Running Scripts
What Is a Script?
Executing a Script
Script Tips and Hints
Getting Help
Appendix: Example Reports
Virtual Machines
Guest Operating Systems
Hosts
Clusters
End-User License Agreement
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Cover
Next
Next Chapter
Titlepage
CONTENTS
Titlepage
Copyright
Dedication
Acknowledgments
About the Authors
Introduction
Part I: Install, Configure, and Manage the vSphere Environment
Chapter 1: Automating vCenter Server Deployment and Configuration
Prepare the vCenter Installation
Create an Automated Installation
Set Up Your vCenter Server Folder Structure
Define Users and Their Privileges
Configure Datacenters and Clusters
Licensing
Chapter 2: Automating vSphere Hypervisor Deployment and Configuration
Prepare for an Installation
Automate an Installation
Chapter 3: Automating Networking
Chapter 4: Automating Storage
Set Up the Storage
Storage Policies
vSphere APIs for I/O Filtering
VSAN
Part II: Managing the Virtual Machine Life Cycle
Using Advanced vSphere Features
Configure EVC
vFlash Read Cache
Manage DRS Groups
Use Fault Tolerance
Use Distributed Power Management
Configure Host Profiles
Configure Active Directory Integration
Chapter 6: Creating Virtual Machines
Use the New-VM Cmdlet
Perform a Mass Deployment
Maintain VMware Tools
Chapter 7: Using Templates and Customization Specifications
Use Customization Specifications
Use Templates
Chapter 8: Configuring Virtual Machine Hardware
Add, Configure, and Remove Virtual Hardware
Optimize Storage Usage with Thin Provisioning
Chapter 9: Advanced Virtual Machine Features
Interact with the Guest OS
Use vMotion and Storage vMotion
Use and Manage Snapshots
Chapter 10: Using vApps
Import Virtual Appliances
Create Your Own vApps
Maintain vApps
Part III: Securing Your vSphere Environment
Chapter 11: Backing Up and Restoring Your Virtual Machines
Work with Snapshots
Create Do-It-Yourself Backups
Restore Your VMs from a DIY Backup
Change Block Tracking
Provide PowerShell Support for Corporate Backup Applications
Chapter 12: Organize Your Disaster Recovery
Back Up Your vCenter Server Database
Restore Your vCenter Server
Export vCenter Server Inventory Items
Import vCenter Server Inventory Items
Recover Virtual Machines
Chapter 13: Hardening the vSphere Environment
Use the Hardening Guides
Work with the Guidelines
Bring It All Together
Chapter 14: Maintain Security in Your vSphere Environment
Install the vCenter Update Manager PowerCLI Snap-in
Work with Baselines
Work with Upgrades and Patches
Report the Security Status
Applying Patches Without vSphere Update Manager
Part IV: Monitoring and Reporting
Chapter 15: Reporting and Auditing
The Basics
Information Sources
Report Formats
Chapter 16: Using Statistical Data
Understand Some Basic Concepts
Gather Statistical Data
Offload Statistical Data
Chapter 17: Alarms
Determine What to Monitor
Use Alarms
Part V: Integration
Chapter 18: The SDK
Work with the vSphere SDK
Use the vSphere API Reference
Use Managed Objects
Code Parameter Objects
Find the Method You Need
Understand Return Values and Faults
Put Some Tips and Tricks to Good Use
Chapter 19: vCloud Director
Prerequisites
Connecting to vCloud Director
Manage Organizations
Manage Users
Manage vDCs
Manage vApps
Manage VMs
vCloud Director Networks
Search-Cloud
Chapter 20: vCloud Air
Prerequisites
General
vCloud Air Authentication
Set-PowerCLIConfiguration
Open-VMConsoleWindow
Tasks
Get-CIView
Chapter 21: vRealize Orchestrator
Requirements
Running an External Script
Receiving a Return Code from an External Script
Use Cases
Alternative Method to the PowerShell Plug-in
Calling vRO Workflows from PowerShell
Chapter 22: Site Recovery Manager
What Is SRM?
Exploring the SRM Cmdlets
Chapter 23: PowerActions
Requirements
Installation and Initial Configuration
PowerCLI Console
PowerCLI Scripts
Further Use Cases
Final Thoughts
Part VI: PowerCLI and DevOps
Chapter 24: Source Control
File Services
Apache Subversion
GitHub
Chapter 25: Running Scripts
What Is a Script?
Executing a Script
Script Tips and Hints
Getting Help
Appendix: Example Reports
Virtual Machines
Guest Operating Systems
Hosts
Clusters
End-User License Agreement
List of Tables
Table 6-1
Table 8-1
Table 8-2
Table 8-3
Table 9-1
Table 9-2
Table 13-1
Table 14-1
Table 14-2
Table 16-1
Table 16-2
Table 17-1
Table 17-2
Table 17-3
Table 17-4
Table 17-5
Table 17-6
Table 18-1
Table 18-2
Table 18-3
Table 18-4
Table 19-1
List of Illustrations
Figure 1-1
Figure 1-2
Figure 1-3
Figure 1-4
Figure 1-5
Figure 2-1
Figure 2-2
Figure 2-3
Figure 2-4
Figure 3-1
Figure 4-1
Figure 4-2
Figure 4-3
Figure 6-1
Figure 6-2
Figure 8-1
Figure 8-2
Figure 9-1
Figure 12-1
Figure 12-2
Figure 12-3
Figure 14-1
Figure 14-2
Figure 14-3
Figure 14-4
Figure 14-5
Figure 15-1
Figure 15-2
Figure 15-3
Figure 15-4
Figure 16-1
Figure 16-2
Figure 16-3
Figure 16-4
Figure 17-1
Figure 17-2
Figure 18-1
Figure 18-2
Figure 18-3
Figure 18-4
Figure 18-5
Figure 18-6
Figure 18-7
Figure 18-8
Figure 18-9
Figure 18-10
Figure 18-11
Figure 18-12
Figure 18-13
Figure 18-14
Figure 18-15
Figure 18-16
Figure 19-1
Figure 19-2
Figure 21-1
Figure 21-2
Figure 21-3
Figure 21-4
Figure 21-5
Figure 21-6
Figure 21-7
Figure 21-8
Figure 21-9
Figure 21-10
Figure 21-11
Figure 21-12
Figure 21-13
Figure 21-14
Figure 21-15
Figure 21-16
Figure 21-17
Figure 21-18
Figure 21-19
Figure 21-20
Figure 21-21
Figure 21-22
Figure 21-23
Figure 21-24
Figure 21-25
Figure 21-26
Figure 21-27
Figure 21-28
Figure 21-29
Figure 21-30
Figure 21-31
Figure 21-32
Figure 21-33
Figure 21-34
Figure 21-35
Figure 21-36
Figure 21-37
Figure 21-38
Figure 21-39
Figure 21-40
Figure 21-41
Figure 21-42
Figure 23-1
Figure 23-2
Figure 23-3
Figure 23-4
Figure 23-5
Figure 23-6
Figure 23-7
Figure 23-8
Figure 23-9
Figure 23-10
Figure 23-11
Figure 23-12
Figure 23-13
Figure 23-14
Figure 23-15
Figure 23-16
Figure 23-17
Figure 23-18
Figure 23-19
Figure 23-20
Figure 23-21
Figure 23-22
Figure 23-23
Figure 23-24
Figure 23-25
Figure 23-26
Figure 23-27
Figure 23-28
Figure 23-29
Figure 23-30
Figure 23-31
Figure 23-32
Figure 23-33
Figure 23-34
Figure 23-35
Figure 23-36
Figure 24-1
Figure 24-2
Figure 24-3
Figure 24-4
Figure 24-5
Figure 24-6
Figure 24-7
Figure 24-8
Figure 24-9
Figure 24-10
Figure 24-11
Figure 24-12
Figure 24-13
Figure 24-14
Figure 24-15
Figure 24-16
Figure 24-17
Figure 24-18
Figure 24-19
Figure 24-20
Figure 24-21
Figure 24-22
Figure 24-23
Figure 24-24
Figure 24-25
Figure 24-26
Figure 24-27
Figure 24-28
Figure 24-29
Figure 24-30
Figure 24-31
Figure 24-32
Figure 24-33
Figure 24-34
Figure 24-35
Figure 24-36
Figure 24-37
Figure 24-38
Figure 24-39
Figure 24-40
Figure 24-41
Figure 24-42
Figure 24-43
Figure 24-44
Figure 24-45
Figure 24-46
Figure 24-47
Figure 24-48
Figure 24-49
Figure 24-50
Figure 24-51
Figure 24-52
Figure 24-53
Figure 24-54
Figure 24-55
Figure 24-56
Figure 24-57
Figure 24-58
Figure 24-59
Figure 24-60
Figure 25-1
Figure 25-2
Figure 25-3
Figure 25-4
Figure 25-5
Figure 25-6
Guide
Cover
Title Page
Front Matter
Dedication
Introduction
Chapter 1: Automating vCenter Server Deployment and Configuration
Start Reading
Example Reports
End-User License Agreement
Pages
iii
iv
v
vii
viii
ix
x
xxiii
xxiv
xxv
xxvi
xxvii
xxviii
xxix
xxx
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
26
27
28
29
30
31
32
33
34
35
36
37
38
39
41
42
43
44
45
46
47
48
49
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
1
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
230
231
232
233
234
235
236
237
238
239
240
241
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
426
427
428
429
430
431
432
433
434
435
436
437
438
439
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
486
487
488
489
490
491
492
493
494
497
498
499
500
501
502
503
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
542
543
544
545
546
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
621
622
623
624
625
626
628
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
679
680
681
682
683
684
685
686
687
688
689
690
691
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
719
720
721
722
724
725
726
727
728
729
730
731
732
735
738
739
740
741
742
743
744
746
748
749
750
751
753
755
756
757
758
759
760
761
764
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
811
812
813
815
816
817
826
827
829
832
833
836
838
841
842
843
844
850
851
852
853
855
856
860
861
862
865
866
867
870
871
872
873
874
875
876
877
878
879
881
883
885
887
888
891
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
211
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset