-
Notifications
You must be signed in to change notification settings - Fork 2
/
vds.go
14714 lines (14133 loc) · 465 KB
/
vds.go
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
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
118
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
164
165
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
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
329
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
372
373
374
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
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
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
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
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
541
542
543
544
545
546
547
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
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
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
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
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
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// The vds package implements the VDS client protocol.
//
// # Introduction
//
// The Virtual Disk Service (VDS) Remote Protocol is a set of Distributed Component
// Object Model (DCOM) interfaces for managing the configuration of disk storage on
// a computer. The Virtual Disk Service Remote Protocol deals with detailed low-level
// operating system and storage concepts.
//
// Although this specification outlines the basic concepts that you need to know, this
// specification assumes that you are familiar with these technologies. For information
// about storage, disk, and volume concepts, see [MSDN-STC] and [MSDN-PARTITIONINFO];
// for information on disk management, see [MSDN-DISKMAN].
//
// The Virtual Disk Service Remote Protocol is used to programmatically enumerate and
// configure disks, volumes, host bus adapter (HBA) ports, and iSCSI initiators on remote
// computers. This protocol supersedes the Disk Management Remote Protocol, as specified
// in [MS-DMRP].
//
// # Overview
//
// The Virtual Disk Service Remote Protocol provides a mechanism for remote configuration
// of disks, partitions, volumes, and iSCSI initiators on a server. Through the Virtual
// Disk Service Remote Protocol, a client can change the configuration of disks into
// partitions, partitions into volumes, and volumes into file systems. The protocol
// also enables clients to obtain notifications of changes to these storage objects.
//
// In the Virtual Disk Service Remote Protocol, two entities are involved: the server,
// whose storage is configured, and the client, which accesses and requests changes
// to the server storage configuration.
//
// The Virtual Disk Service Remote Protocol is expressed as a set of DCOM interfaces.
// For a server, this protocol implements support for the DCOM interface in order to
// manage storage. For a client, this protocol invokes method calls on the interface
// in order to perform disk and volume configuration tasks on the server.<1>
package vds
import (
"context"
"fmt"
"strings"
"unicode/utf16"
dcerpc "github.com/oiweiwei/go-msrpc/dcerpc"
errors "github.com/oiweiwei/go-msrpc/dcerpc/errors"
uuid "github.com/oiweiwei/go-msrpc/midl/uuid"
dcom "github.com/oiweiwei/go-msrpc/msrpc/dcom"
dtyp "github.com/oiweiwei/go-msrpc/msrpc/dtyp"
ndr "github.com/oiweiwei/go-msrpc/ndr"
)
var (
_ = context.Background
_ = fmt.Errorf
_ = utf16.Encode
_ = strings.TrimPrefix
_ = ndr.ZeroString
_ = (*uuid.UUID)(nil)
_ = (*dcerpc.SyntaxID)(nil)
_ = (*errors.Error)(nil)
_ = dtyp.GoPackage
_ = dcom.GoPackage
)
var (
// import guard
GoPackage = "dcom/vds"
)
// MaxPath represents the MAX_PATH RPC constant
var MaxPath = 260
// MaxFSNameSize represents the MAX_FS_NAME_SIZE RPC constant
var MaxFSNameSize = 8
// VerVDSLUNInformation represents the VER_VDS_LUN_INFORMATION RPC constant
var VerVDSLUNInformation = 1
// NFPackArrive represents the VDS_NF_PACK_ARRIVE RPC constant
var NFPackArrive = 1
// NFPackDepart represents the VDS_NF_PACK_DEPART RPC constant
var NFPackDepart = 2
// NFPackModify represents the VDS_NF_PACK_MODIFY RPC constant
var NFPackModify = 3
// NFVolumeArrive represents the VDS_NF_VOLUME_ARRIVE RPC constant
var NFVolumeArrive = 4
// NFVolumeDepart represents the VDS_NF_VOLUME_DEPART RPC constant
var NFVolumeDepart = 5
// NFVolumeModify represents the VDS_NF_VOLUME_MODIFY RPC constant
var NFVolumeModify = 6
// NFVolumeRebuildingProgress represents the VDS_NF_VOLUME_REBUILDING_PROGRESS RPC constant
var NFVolumeRebuildingProgress = 7
// NFDiskArrive represents the VDS_NF_DISK_ARRIVE RPC constant
var NFDiskArrive = 8
// NFDiskDepart represents the VDS_NF_DISK_DEPART RPC constant
var NFDiskDepart = 9
// NFDiskModify represents the VDS_NF_DISK_MODIFY RPC constant
var NFDiskModify = 10
// NFPartitionArrive represents the VDS_NF_PARTITION_ARRIVE RPC constant
var NFPartitionArrive = 11
// NFPartitionDepart represents the VDS_NF_PARTITION_DEPART RPC constant
var NFPartitionDepart = 12
// NFPartitionModify represents the VDS_NF_PARTITION_MODIFY RPC constant
var NFPartitionModify = 13
// NFDriveLetterFree represents the VDS_NF_DRIVE_LETTER_FREE RPC constant
var NFDriveLetterFree = 201
// NFDriveLetterAssign represents the VDS_NF_DRIVE_LETTER_ASSIGN RPC constant
var NFDriveLetterAssign = 202
// NFFileSystemModify represents the VDS_NF_FILE_SYSTEM_MODIFY RPC constant
var NFFileSystemModify = 203
// NFFileSystemFormatProgress represents the VDS_NF_FILE_SYSTEM_FORMAT_PROGRESS RPC constant
var NFFileSystemFormatProgress = 204
// NFMountPointsChange represents the VDS_NF_MOUNT_POINTS_CHANGE RPC constant
var NFMountPointsChange = 205
// NFServiceOutOfSync represents the VDS_NF_SERVICE_OUT_OF_SYNC RPC constant
var NFServiceOutOfSync = 301
// ObjectID structure represents VDS_OBJECT_ID RPC structure.
type ObjectID dtyp.GUID
func (o *ObjectID) GUID() *dtyp.GUID { return (*dtyp.GUID)(o) }
func (o *ObjectID) xxx_PreparePayload(ctx context.Context) error {
if hook, ok := (interface{})(o).(interface{ AfterPreparePayload(context.Context) error }); ok {
if err := hook.AfterPreparePayload(ctx); err != nil {
return err
}
}
return nil
}
func (o *ObjectID) MarshalNDR(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PreparePayload(ctx); err != nil {
return err
}
if err := w.WriteAlign(4); err != nil {
return err
}
if err := w.WriteData(o.Data1); err != nil {
return err
}
if err := w.WriteData(o.Data2); err != nil {
return err
}
if err := w.WriteData(o.Data3); err != nil {
return err
}
for i1 := range o.Data4 {
i1 := i1
if uint64(i1) >= 8 {
break
}
if err := w.WriteData(o.Data4[i1]); err != nil {
return err
}
}
for i1 := len(o.Data4); uint64(i1) < 8; i1++ {
if err := w.WriteData(uint8(0)); err != nil {
return err
}
}
return nil
}
func (o *ObjectID) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
if err := w.ReadAlign(4); err != nil {
return err
}
if err := w.ReadData(&o.Data1); err != nil {
return err
}
if err := w.ReadData(&o.Data2); err != nil {
return err
}
if err := w.ReadData(&o.Data3); err != nil {
return err
}
o.Data4 = make([]byte, 8)
for i1 := range o.Data4 {
i1 := i1
if err := w.ReadData(&o.Data4[i1]); err != nil {
return err
}
}
return nil
}
// Health type represents VDS_HEALTH RPC enumeration.
//
// The VDS_HEALTH enumeration defines the possible health states of the storage objects
// in the Virtual Disk Service Remote Protocol. The storage objects are packs, volumes,
// volume plexes and disks.
type Health uint16
var (
// VDS_H_UNKNOWN: The health of the object cannot be determined.
HealthUnknown Health = 0
// VDS_H_HEALTHY: The object indicates online status. If the object is a disk, the
// disk is not missing, dynamic disk log and configuration files are synchronized, and
// the disk is free of input/output errors. If the object is a LUN or volume, all plexes
// (mirrored, simple, spanned, and striped) and columns (RAID-5) are active. For a volume,
// VDS_H_HEALTHY implies no disks containing volume extents have IO errors. For a LUN,
// VDS_H_HEALTHY implies no drives containing LUN extents have IO errors.
HealthHealthy Health = 1
// VDS_H_REBUILDING: The volume is resynchronizing all plexes, or a striped with parity
// (RAID-5) plex is regenerating the parity.
HealthRebuilding Health = 2
// VDS_H_STALE: The object configuration is stale.
HealthStale Health = 3
// VDS_H_FAILING: The object is failing but still working. For example, a volume with
// failing health might produce occasional input/output errors from which it can still
// recover.
HealthFailing Health = 4
// VDS_H_FAILING_REDUNDANCY: One or more plexes have errors, but the object is working
// and all plexes are online.
HealthFailingRedundancy Health = 5
// VDS_H_FAILED_REDUNDANCY: One or more plexes have failed, but at least one plex
// is working.
HealthFailedRedundancy Health = 6
// VDS_H_FAILED_REDUNDANCY_FAILING: The last working plex is failing.
HealthFailedRedundancyFailing Health = 7
// VDS_H_FAILED: The object has failed. Any object with a failed health status also
// has a failed object status.
HealthFailed Health = 8
)
func (o Health) String() string {
switch o {
case HealthUnknown:
return "HealthUnknown"
case HealthHealthy:
return "HealthHealthy"
case HealthRebuilding:
return "HealthRebuilding"
case HealthStale:
return "HealthStale"
case HealthFailing:
return "HealthFailing"
case HealthFailingRedundancy:
return "HealthFailingRedundancy"
case HealthFailedRedundancy:
return "HealthFailedRedundancy"
case HealthFailedRedundancyFailing:
return "HealthFailedRedundancyFailing"
case HealthFailed:
return "HealthFailed"
}
return "Invalid"
}
// NotificationTargetType type represents VDS_NOTIFICATION_TARGET_TYPE RPC enumeration.
//
// The VDS_NOTIFICATION_TARGET_TYPE enumeration defines the set of valid target types
// (subjects) of a Virtual Disk Service Remote Protocol notification.
type NotificationTargetType uint16
var (
// VDS_NTT_UNKNOWN: Notification is of an unknown type.
NotificationTargetTypeUnknown NotificationTargetType = 0
// VDS_NTT_PACK: Notification refers to a pack.
NotificationTargetTypePack NotificationTargetType = 10
// VDS_NTT_VOLUME: Notification refers to a volume.
NotificationTargetTypeVolume NotificationTargetType = 11
// VDS_NTT_DISK: Notification refers to a disk.
NotificationTargetTypeDisk NotificationTargetType = 13
// VDS_NTT_PARTITION: Notification refers to a partition.
NotificationTargetTypePartition NotificationTargetType = 60
// VDS_NTT_DRIVE_LETTER: Notification refers to a drive letter.
NotificationTargetTypeDriveLetter NotificationTargetType = 61
// VDS_NTT_FILE_SYSTEM: Notification refers to a file system.
NotificationTargetTypeFileSystem NotificationTargetType = 62
// VDS_NTT_MOUNT_POINT: Notification refers to a mount point.
NotificationTargetTypeMountPoint NotificationTargetType = 63
// VDS_NTT_SERVICE: Notification refers to the Virtual Disk Service.<6>
NotificationTargetTypeService NotificationTargetType = 200
)
func (o NotificationTargetType) String() string {
switch o {
case NotificationTargetTypeUnknown:
return "NotificationTargetTypeUnknown"
case NotificationTargetTypePack:
return "NotificationTargetTypePack"
case NotificationTargetTypeVolume:
return "NotificationTargetTypeVolume"
case NotificationTargetTypeDisk:
return "NotificationTargetTypeDisk"
case NotificationTargetTypePartition:
return "NotificationTargetTypePartition"
case NotificationTargetTypeDriveLetter:
return "NotificationTargetTypeDriveLetter"
case NotificationTargetTypeFileSystem:
return "NotificationTargetTypeFileSystem"
case NotificationTargetTypeMountPoint:
return "NotificationTargetTypeMountPoint"
case NotificationTargetTypeService:
return "NotificationTargetTypeService"
}
return "Invalid"
}
// AsyncOutputType type represents VDS_ASYNC_OUTPUT_TYPE RPC enumeration.
//
// The VDS_ASYNC_OUTPUT_TYPE enumeration defines the types of operation information
// that the VDS_ASYNC_OUTPUT structure returns.
type AsyncOutputType uint16
var (
// VDS_ASYNCOUT_UNKNOWN: Information is about an unknown type of operation.
AsyncOutputTypeUnknown AsyncOutputType = 0
// VDS_ASYNCOUT_CREATEVOLUME: Information is about creating a volume.
AsyncOutputTypeCreateVolume AsyncOutputType = 1
// VDS_ASYNCOUT_EXTENDVOLUME: Information is about extending the size of a volume.
AsyncOutputTypeExtendVolume AsyncOutputType = 2
// VDS_ASYNCOUT_SHRINKVOLUME: Information is about shrinking the size of a volume.
AsyncOutputTypeShrinkVolume AsyncOutputType = 3
// VDS_ASYNCOUT_ADDVOLUMEPLEX: Information is about adding a volume plex.
AsyncOutputTypeAddVolumePlex AsyncOutputType = 4
// VDS_ASYNCOUT_BREAKVOLUMEPLEX: Information is about breaking a volume plex.
AsyncOutputTypeBreakVolumePlex AsyncOutputType = 5
// VDS_ASYNCOUT_REMOVEVOLUMEPLEX: Information is about removing a volume plex.
AsyncOutputTypeRemoveVolumePlex AsyncOutputType = 6
// VDS_ASYNCOUT_REPAIRVOLUMEPLEX: Information is about repairing a volume plex.
AsyncOutputTypeRepairVolumePlex AsyncOutputType = 7
// VDS_ASYNCOUT_RECOVERPACK: Information is about recovering a pack.
AsyncOutputTypeRecoverPack AsyncOutputType = 8
// VDS_ASYNCOUT_REPLACEDISK: Information is about replacing a disk.
AsyncOutputTypeReplaceDisk AsyncOutputType = 9
// VDS_ASYNCOUT_CREATEPARTITION: Information is about creating a partition.
AsyncOutputTypeCreatePartition AsyncOutputType = 10
// VDS_ASYNCOUT_CLEAN: Information is about cleaning a disk.
AsyncOutputTypeClean AsyncOutputType = 11
// VDS_ASYNCOUT_CREATELUN: Information is about creating a LUN.
AsyncOutputTypeCreateLUN AsyncOutputType = 50
// VDS_ASYNCOUT_FORMAT: Information is about formatting a file system.
AsyncOutputTypeFormat AsyncOutputType = 101
// VDS_ASYNCOUT_CREATE_VDISK: Information is about creating a virtual disk.
AsyncOutputTypeCreateVDisk AsyncOutputType = 200
// VDS_ASYNCOUT_SURFACE_VDISK: Information is about attaching a virtual disk.
AsyncOutputTypeSurfaceVDisk AsyncOutputType = 201
// VDS_ASYNCOUT_COMPACT_VDISK: Information is about compacting a virtual disk.
AsyncOutputTypeCompactVDisk AsyncOutputType = 202
// VDS_ASYNCOUT_MERGE_VDISK: Information is about merging a virtual disk.
AsyncOutputTypeMergeVDisk AsyncOutputType = 203
// VDS_ASYNCOUT_EXPAND_VDISK: Information is about expanding a virtual disk.
AsyncOutputTypeExpandVDisk AsyncOutputType = 204
)
func (o AsyncOutputType) String() string {
switch o {
case AsyncOutputTypeUnknown:
return "AsyncOutputTypeUnknown"
case AsyncOutputTypeCreateVolume:
return "AsyncOutputTypeCreateVolume"
case AsyncOutputTypeExtendVolume:
return "AsyncOutputTypeExtendVolume"
case AsyncOutputTypeShrinkVolume:
return "AsyncOutputTypeShrinkVolume"
case AsyncOutputTypeAddVolumePlex:
return "AsyncOutputTypeAddVolumePlex"
case AsyncOutputTypeBreakVolumePlex:
return "AsyncOutputTypeBreakVolumePlex"
case AsyncOutputTypeRemoveVolumePlex:
return "AsyncOutputTypeRemoveVolumePlex"
case AsyncOutputTypeRepairVolumePlex:
return "AsyncOutputTypeRepairVolumePlex"
case AsyncOutputTypeRecoverPack:
return "AsyncOutputTypeRecoverPack"
case AsyncOutputTypeReplaceDisk:
return "AsyncOutputTypeReplaceDisk"
case AsyncOutputTypeCreatePartition:
return "AsyncOutputTypeCreatePartition"
case AsyncOutputTypeClean:
return "AsyncOutputTypeClean"
case AsyncOutputTypeCreateLUN:
return "AsyncOutputTypeCreateLUN"
case AsyncOutputTypeFormat:
return "AsyncOutputTypeFormat"
case AsyncOutputTypeCreateVDisk:
return "AsyncOutputTypeCreateVDisk"
case AsyncOutputTypeSurfaceVDisk:
return "AsyncOutputTypeSurfaceVDisk"
case AsyncOutputTypeCompactVDisk:
return "AsyncOutputTypeCompactVDisk"
case AsyncOutputTypeMergeVDisk:
return "AsyncOutputTypeMergeVDisk"
case AsyncOutputTypeExpandVDisk:
return "AsyncOutputTypeExpandVDisk"
}
return "Invalid"
}
// StorageBusType type represents VDS_STORAGE_BUS_TYPE RPC enumeration.
//
// The VDS_STORAGE_BUS_TYPE enumeration defines the type of bus on which a disk resides.
type StorageBusType uint16
var (
// VDSBusTypeUnknown: Bus type is unknown.
StorageBusTypeUnknown StorageBusType = 0
// VDSBusTypeScsi: Disk resides on a SCSI bus.
StorageBusTypeSCSI StorageBusType = 1
// VDSBusTypeAtapi: Disk resides on an AT Attachment Packet Interface (ATAPI) bus.
// For more information on this bus type, see [ANSI/INCITS-397-2005].
StorageBusTypeATAPI StorageBusType = 2
// VDSBusTypeAta: Disk resides on an AT Attached (ATA) bus. For more information on
// this bus type, see [ANSI/INCITS-451-2008].
StorageBusTypeATA StorageBusType = 3
// VDSBusType1394: Disk resides on an IEEE 1394 bus. For more information, see [IEEE1394-2008].
StorageBusTypeType1394 StorageBusType = 4
// VDSBusTypeSsa: Disk resides on a serial storage architecture (SSA) bus. For more
// information on this bus type, see [IEEE-SSA].
StorageBusTypeSSA StorageBusType = 5
// VDSBusTypeFibre: Disk resides on a fiber channel bus.
StorageBusTypeFibre StorageBusType = 6
// VDSBusTypeUsb: Disk resides on a universal serial bus (USB).
StorageBusTypeUSB StorageBusType = 7
// VDSBusTypeRAID: Disk resides on a RAID bus.
StorageBusTypeRAID StorageBusType = 8
// VDSBusTypeiScsi: Disk resides on an iSCSI bus.
StorageBusTypeISCSI StorageBusType = 9
// VDSBusTypeSas: Disk resides on a Serial Attached SCSI (SAS) bus. For more information
// on this bus type, see [ANSI/INCITS-457-2010].
StorageBusTypeSAS StorageBusType = 10
// VDSBusTypeSata: Disk resides on a Serial ATA (SATA) bus. For more information on
// this bus type, see [SATA-3.0].
StorageBusTypeSATA StorageBusType = 11
// VDSBusTypeSd: Disk resides on a secure digital (SD) bus.
StorageBusTypeSD StorageBusType = 12
// VDSBusTypeMmc: Indicates a multimedia card (MMC) bus type. For information on multimedia
// cards, which are a flash memory card standard, see [JEDEC-MO227-A].
StorageBusTypeMMC StorageBusType = 13
// VDSBusTypeMax: Maximum bus type value. Note that this value does not identify a
// particular bus type; rather, it serves as an end value of the enumeration.<7>
StorageBusTypeMax StorageBusType = 14
// VDSBusTypeVirtual: The disk SHOULD<8> reside on a virtual bus
StorageBusTypeVirtual StorageBusType = 14
// VDSBusTypeFileBackedVirtual: Disk is backed by a file.
StorageBusTypeFileBackedVirtual StorageBusType = 15
// VDSBusTypeSpaces: The disk SHOULD<9> be backed by Storage Spaces.
StorageBusTypeSpaces StorageBusType = 16
// VDSBusTypeMaxReserved: Maximum reserved bus type value. Bus type values below this
// range are reserved.
StorageBusTypeMaxReserved StorageBusType = 127
)
func (o StorageBusType) String() string {
switch o {
case StorageBusTypeUnknown:
return "StorageBusTypeUnknown"
case StorageBusTypeSCSI:
return "StorageBusTypeSCSI"
case StorageBusTypeATAPI:
return "StorageBusTypeATAPI"
case StorageBusTypeATA:
return "StorageBusTypeATA"
case StorageBusTypeType1394:
return "StorageBusTypeType1394"
case StorageBusTypeSSA:
return "StorageBusTypeSSA"
case StorageBusTypeFibre:
return "StorageBusTypeFibre"
case StorageBusTypeUSB:
return "StorageBusTypeUSB"
case StorageBusTypeRAID:
return "StorageBusTypeRAID"
case StorageBusTypeISCSI:
return "StorageBusTypeISCSI"
case StorageBusTypeSAS:
return "StorageBusTypeSAS"
case StorageBusTypeSATA:
return "StorageBusTypeSATA"
case StorageBusTypeSD:
return "StorageBusTypeSD"
case StorageBusTypeMMC:
return "StorageBusTypeMMC"
case StorageBusTypeMax:
return "StorageBusTypeMax"
case StorageBusTypeVirtual:
return "StorageBusTypeVirtual"
case StorageBusTypeFileBackedVirtual:
return "StorageBusTypeFileBackedVirtual"
case StorageBusTypeSpaces:
return "StorageBusTypeSpaces"
case StorageBusTypeMaxReserved:
return "StorageBusTypeMaxReserved"
}
return "Invalid"
}
// StorageIDCodeSet type represents VDS_STORAGE_IDENTIFIER_CODE_SET RPC enumeration.
//
// The VDS_STORAGE_IDENTIFIER_CODE_SET enumeration defines the code set that is used
// by the storage device identifier, as specified in [SPC-3]
type StorageIDCodeSet uint16
var (
// VDSStorageIdCodeSetReserved: This value is reserved by the SPC-3 standard and is
// not used.
StorageIDCodeSetReserved StorageIDCodeSet = 0
// VDSStorageIdCodeSetBinary: The identifier contains binary values.
StorageIDCodeSetBinary StorageIDCodeSet = 1
// VDSStorageIdCodeSetAscii: The identifier contains ASCII values.
StorageIDCodeSetASCII StorageIDCodeSet = 2
// VDSStorageIdCodeSetUtf8: The identifier contains UTF-8 values.
StorageIDCodeSetUTF8 StorageIDCodeSet = 3
)
func (o StorageIDCodeSet) String() string {
switch o {
case StorageIDCodeSetReserved:
return "StorageIDCodeSetReserved"
case StorageIDCodeSetBinary:
return "StorageIDCodeSetBinary"
case StorageIDCodeSetASCII:
return "StorageIDCodeSetASCII"
case StorageIDCodeSetUTF8:
return "StorageIDCodeSetUTF8"
}
return "Invalid"
}
// StorageIDType type represents VDS_STORAGE_IDENTIFIER_TYPE RPC enumeration.
//
// The VDS_STORAGE_IDENTIFIER_TYPE enumeration defines the types of storage device identifiers,
// as specified in [SPC-3].
type StorageIDType uint16
var (
// VDSStorageIdTypeVendorSpecific: Storage identifier is vendor-specific.
StorageIDTypeVendorSpecific StorageIDType = 0
// VDSStorageIdTypeVendorId: Storage identifier is a vendor identifier.
StorageIDTypeVendorID StorageIDType = 1
// VDSStorageIdTypeEUI64: Storage identifier is a 64-bit extended unique identifier
// (EUI-64).
StorageIDTypeEUI64 StorageIDType = 2
// VDSStorageIdTypeFCPHName: Storage identifier is a Fibre Channel Physical and Signaling
// Interface (FC-PH) identifier.
StorageIDTypeFCPHName StorageIDType = 3
// VDSStorageIdTypePortRelative: Storage identifier is a relative target port identifier.
StorageIDTypePortRelative StorageIDType = 4
// VDSStorageIdTypeTargetPortGroup: Storage identifier is a target port group number.
StorageIDTypeTargetPortGroup StorageIDType = 5
// VDSStorageIdTypeLogicalUnitGroup: Storage identifier is a logical unit group number.
StorageIDTypeLogicalUnitGroup StorageIDType = 6
// VDSStorageIdTypeMD5LogicalUnitIdentifier: Storage identifier is an MD5 logical
// unit number (LUN).
StorageIDTypeMD5LogicalUnitID StorageIDType = 7
// VDSStorageIdTypeScsiNameString: Storage identifier is an SCSI name string identifier.
StorageIDTypeSCSINameString StorageIDType = 8
)
func (o StorageIDType) String() string {
switch o {
case StorageIDTypeVendorSpecific:
return "StorageIDTypeVendorSpecific"
case StorageIDTypeVendorID:
return "StorageIDTypeVendorID"
case StorageIDTypeEUI64:
return "StorageIDTypeEUI64"
case StorageIDTypeFCPHName:
return "StorageIDTypeFCPHName"
case StorageIDTypePortRelative:
return "StorageIDTypePortRelative"
case StorageIDTypeTargetPortGroup:
return "StorageIDTypeTargetPortGroup"
case StorageIDTypeLogicalUnitGroup:
return "StorageIDTypeLogicalUnitGroup"
case StorageIDTypeMD5LogicalUnitID:
return "StorageIDTypeMD5LogicalUnitID"
case StorageIDTypeSCSINameString:
return "StorageIDTypeSCSINameString"
}
return "Invalid"
}
// InterconnectAddressType type represents VDS_INTERCONNECT_ADDRESS_TYPE RPC enumeration.
//
// The VDS_INTERCONNECT_ADDRESS_TYPE enumeration defines the set of valid address types
// of a physical interconnect.
type InterconnectAddressType uint16
var (
// VDS_IA_UNKNOWN: This value is reserved.
InterconnectAddressTypeUnknown InterconnectAddressType = 0
// VDS_IA_FCFS: Address type is first come, first served.
InterconnectAddressTypeFCFS InterconnectAddressType = 1
// VDS_IA_FCPH: Address type is FC-PH. For more information, see [ANSI-289-1996].
InterconnectAddressTypeFCPH InterconnectAddressType = 2
// VDS_IA_FCPH3: Address type is FC-PH-3. For more information, see [ANSI-289-1996].
InterconnectAddressTypeFCPH3 InterconnectAddressType = 3
// VDS_IA_MAC: Address type is media access control (MAC).
InterconnectAddressTypeMAC InterconnectAddressType = 4
// VDS_IA_SCSI: Address type is SCSI.
InterconnectAddressTypeSCSI InterconnectAddressType = 5
)
func (o InterconnectAddressType) String() string {
switch o {
case InterconnectAddressTypeUnknown:
return "InterconnectAddressTypeUnknown"
case InterconnectAddressTypeFCFS:
return "InterconnectAddressTypeFCFS"
case InterconnectAddressTypeFCPH:
return "InterconnectAddressTypeFCPH"
case InterconnectAddressTypeFCPH3:
return "InterconnectAddressTypeFCPH3"
case InterconnectAddressTypeMAC:
return "InterconnectAddressTypeMAC"
case InterconnectAddressTypeSCSI:
return "InterconnectAddressTypeSCSI"
}
return "Invalid"
}
// FileSystemType type represents VDS_FILE_SYSTEM_TYPE RPC enumeration.
//
// The VDS_FILE_SYSTEM_TYPE enumeration defines the set of valid types for a file system.
type FileSystemType uint16
var (
// VDS_FST_UNKNOWN: The file system is unknown.
FileSystemTypeUnknown FileSystemType = 0
// VDS_FST_RAW: The file system is raw.
FileSystemTypeRaw FileSystemType = 1
// VDS_FST_FAT: The file system is a FAT file system.
FileSystemTypeFAT FileSystemType = 2
// VDS_FST_FAT32: The file system is FAT32.
FileSystemTypeFAT32 FileSystemType = 3
// VDS_FST_NTFS: The file system is the NTFS file system.
FileSystemTypeNTFS FileSystemType = 4
// VDS_FST_CDFS: The file system is the Compact Disc File System (CDFS).
FileSystemTypeCDFS FileSystemType = 5
// VDS_FST_UDF: The file system is Universal Disk Format (UDF).
FileSystemTypeUDF FileSystemType = 6
// VDS_FST_EXFAT: The file system is Extended File Allocation Table (ExFAT). For more
// information, see [MSDN-EFFS].
FileSystemTypeExFAT FileSystemType = 7
// VDS_FST_CSVFS<10>: The file system is Cluster Shared Volume File System (CSVFS).
FileSystemTypeCSVFS FileSystemType = 8
// VDS_FST_REFS<11>: The file system is Resilient File System (ReFS).
FileSystemTypeReFS FileSystemType = 9
)
func (o FileSystemType) String() string {
switch o {
case FileSystemTypeUnknown:
return "FileSystemTypeUnknown"
case FileSystemTypeRaw:
return "FileSystemTypeRaw"
case FileSystemTypeFAT:
return "FileSystemTypeFAT"
case FileSystemTypeFAT32:
return "FileSystemTypeFAT32"
case FileSystemTypeNTFS:
return "FileSystemTypeNTFS"
case FileSystemTypeCDFS:
return "FileSystemTypeCDFS"
case FileSystemTypeUDF:
return "FileSystemTypeUDF"
case FileSystemTypeExFAT:
return "FileSystemTypeExFAT"
case FileSystemTypeCSVFS:
return "FileSystemTypeCSVFS"
case FileSystemTypeReFS:
return "FileSystemTypeReFS"
}
return "Invalid"
}
// FileSystemFlag type represents VDS_FILE_SYSTEM_FLAG RPC enumeration.
//
// The VDS_FILE_SYSTEM_FLAG enumeration defines the set of valid flags for a file system
// format type.
//
// If more than one flag is specified, the file system type supports all the file system
// allocation sizes that are specified. However, a specific file system on a volume
// does not have multiple allocation sizes at the same time.
type FileSystemFlag uint32
var (
// VDS_FSF_SUPPORT_FORMAT: If set, the file system format type supports format.
FileSystemFlagSupportFormat FileSystemFlag = 1
// VDS_FSF_SUPPORT_QUICK_FORMAT: If set, the file system format type supports quick
// format.
FileSystemFlagSupportQuickFormat FileSystemFlag = 2
// VDS_FSF_SUPPORT_COMPRESS: If set, the file system format type supports file compression.
FileSystemFlagSupportCompress FileSystemFlag = 4
// VDS_FSF_SUPPORT_SPECIFY_LABEL: If set, the file system format type supports file
// system labels.
FileSystemFlagSupportSpecifyLabel FileSystemFlag = 8
// VDS_FSF_SUPPORT_MOUNT_POINT: If set, the file system format type supports mount
// points.
FileSystemFlagSupportMountPoint FileSystemFlag = 16
// VDS_FSF_SUPPORT_REMOVABLE_MEDIA: If set, the file system format type supports removable
// media.
FileSystemFlagSupportRemovableMedia FileSystemFlag = 32
// VDS_FSF_SUPPORT_EXTEND: If set, the file system format type supports extending
// volumes.
FileSystemFlagSupportExtend FileSystemFlag = 64
// VDS_FSF_ALLOCATION_UNIT_512: If set, the file system format supports allocation
// units of 512 bytes.
FileSystemFlagAllocationUnit512 FileSystemFlag = 65536
// VDS_FSF_ALLOCATION_UNIT_1K: If set, the file system format type supports allocation
// units of 1 kilobyte.
FileSystemFlagAllocationUnit1k FileSystemFlag = 131072
// VDS_FSF_ALLOCATION_UNIT_2K: If set, the file system format type supports allocation
// units of 2 kilobytes.
FileSystemFlagAllocationUnit2k FileSystemFlag = 262144
// VDS_FSF_ALLOCATION_UNIT_4K: If set, the file system format type supports allocation
// units of 4 kilobytes.
FileSystemFlagAllocationUnit4k FileSystemFlag = 524288
// VDS_FSF_ALLOCATION_UNIT_8K: If set, the file system format type supports allocation
// units of 8 kilobytes.
FileSystemFlagAllocationUnit8k FileSystemFlag = 1048576
// VDS_FSF_ALLOCATION_UNIT_16K: If set, the file system format type supports allocation
// units of 16 kilobytes.
FileSystemFlagAllocationUnit16k FileSystemFlag = 2097152
// VDS_FSF_ALLOCATION_UNIT_32K: If set, the file system format type supports allocation
// units of 32 kilobytes.
FileSystemFlagAllocationUnit32k FileSystemFlag = 4194304
// VDS_FSF_ALLOCATION_UNIT_64K: If set, the file system format type supports allocation
// units of 64 kilobytes.
FileSystemFlagAllocationUnit64k FileSystemFlag = 8388608
// VDS_FSF_ALLOCATION_UNIT_128K: If set, the file system format type supports allocation
// units of 128 kilobytes.
FileSystemFlagAllocationUnit128k FileSystemFlag = 16777216
// VDS_FSF_ALLOCATION_UNIT_256K: If set, the file system format type supports allocation
// units of 256 kilobytes.
FileSystemFlagAllocationUnit256k FileSystemFlag = 33554432
)
func (o FileSystemFlag) String() string {
switch o {
case FileSystemFlagSupportFormat:
return "FileSystemFlagSupportFormat"
case FileSystemFlagSupportQuickFormat:
return "FileSystemFlagSupportQuickFormat"
case FileSystemFlagSupportCompress:
return "FileSystemFlagSupportCompress"
case FileSystemFlagSupportSpecifyLabel:
return "FileSystemFlagSupportSpecifyLabel"
case FileSystemFlagSupportMountPoint:
return "FileSystemFlagSupportMountPoint"
case FileSystemFlagSupportRemovableMedia:
return "FileSystemFlagSupportRemovableMedia"
case FileSystemFlagSupportExtend:
return "FileSystemFlagSupportExtend"
case FileSystemFlagAllocationUnit512:
return "FileSystemFlagAllocationUnit512"
case FileSystemFlagAllocationUnit1k:
return "FileSystemFlagAllocationUnit1k"
case FileSystemFlagAllocationUnit2k:
return "FileSystemFlagAllocationUnit2k"
case FileSystemFlagAllocationUnit4k:
return "FileSystemFlagAllocationUnit4k"
case FileSystemFlagAllocationUnit8k:
return "FileSystemFlagAllocationUnit8k"
case FileSystemFlagAllocationUnit16k:
return "FileSystemFlagAllocationUnit16k"
case FileSystemFlagAllocationUnit32k:
return "FileSystemFlagAllocationUnit32k"
case FileSystemFlagAllocationUnit64k:
return "FileSystemFlagAllocationUnit64k"
case FileSystemFlagAllocationUnit128k:
return "FileSystemFlagAllocationUnit128k"
case FileSystemFlagAllocationUnit256k:
return "FileSystemFlagAllocationUnit256k"
}
return "Invalid"
}
// FileSystemPropertyFlag type represents VDS_FILE_SYSTEM_PROP_FLAG RPC enumeration.
//
// The VDS_FILE_SYSTEM_PROP_FLAG enumeration defines the set of fields for a file system.
// A value that accepts these flags SHOULD have the following flag set.
type FileSystemPropertyFlag uint16
var (
// VDS_FPF_COMPRESSED: If set, the file system supports file compression.
FileSystemPropertyFlagCompressed FileSystemPropertyFlag = 1
)
func (o FileSystemPropertyFlag) String() string {
switch o {
case FileSystemPropertyFlagCompressed:
return "FileSystemPropertyFlagCompressed"
}
return "Invalid"
}
// FileSystemFormatSupportFlag type represents VDS_FILE_SYSTEM_FORMAT_SUPPORT_FLAG RPC enumeration.
//
// The VDS_FILE_SYSTEM_FORMAT_SUPPORT_FLAG enumeration defines the properties of file
// systems that are supported for formatting volumes.<12>
type FileSystemFormatSupportFlag uint16
var (
// VDS_FSS_DEFAULT: The file system is the default file system for formatting the
// volume.
FileSystemFormatSupportFlagDefault FileSystemFormatSupportFlag = 1
// VDS_FSS_PREVIOUS_REVISION: The revision of the file system is not the latest revision
// that is supported for formatting the volume.
FileSystemFormatSupportFlagPreviousRevision FileSystemFormatSupportFlag = 2
// VDS_FSS_RECOMMENDED: The file system is the recommended file system for formatting
// the volume.
FileSystemFormatSupportFlagRecommended FileSystemFormatSupportFlag = 4
)
func (o FileSystemFormatSupportFlag) String() string {
switch o {
case FileSystemFormatSupportFlagDefault:
return "FileSystemFormatSupportFlagDefault"
case FileSystemFormatSupportFlagPreviousRevision:
return "FileSystemFormatSupportFlagPreviousRevision"
case FileSystemFormatSupportFlagRecommended:
return "FileSystemFormatSupportFlagRecommended"
}
return "Invalid"
}
// DiskExtentType type represents VDS_DISK_EXTENT_TYPE RPC enumeration.
//
// The VDS_DISK_EXTENT_TYPE enumeration defines the set of valid types for a disk extent.
type DiskExtentType uint16
var (
// VDS_DET_UNKNOWN: The extent belongs to an unknown partition type.
DiskExtentTypeUnknown DiskExtentType = 0
// VDS_DET_FREE: The extent belongs to an area of free space.
DiskExtentTypeFree DiskExtentType = 1
// VDS_DET_DATA: The extent belongs to a volume.
DiskExtentTypeData DiskExtentType = 2
// VDS_DET_OEM: The extent belongs to an OEM partition.
DiskExtentTypeOEM DiskExtentType = 3
// VDS_DET_ESP: The extent belongs to an Extensible Firmware Interface (EFI) system
// partition.
DiskExtentTypeESP DiskExtentType = 4
// VDS_DET_MSR: The extent belongs to a Microsoft Reserved (MSR) partition.
DiskExtentTypeMSR DiskExtentType = 5
// VDS_DET_LDM: The extent belongs to a disk management metadata partition.
DiskExtentTypeLDM DiskExtentType = 6
// VDS_DET_UNUSABLE: The extent belongs to an area of unusable space.
DiskExtentTypeUnusable DiskExtentType = 32767
)
func (o DiskExtentType) String() string {
switch o {
case DiskExtentTypeUnknown:
return "DiskExtentTypeUnknown"
case DiskExtentTypeFree:
return "DiskExtentTypeFree"
case DiskExtentTypeData:
return "DiskExtentTypeData"
case DiskExtentTypeOEM:
return "DiskExtentTypeOEM"
case DiskExtentTypeESP:
return "DiskExtentTypeESP"
case DiskExtentTypeMSR:
return "DiskExtentTypeMSR"
case DiskExtentTypeLDM:
return "DiskExtentTypeLDM"
case DiskExtentTypeUnusable:
return "DiskExtentTypeUnusable"
}
return "Invalid"
}
// PartitionStyle type represents VDS_PARTITION_STYLE RPC enumeration.
//
// The VDS_PARTITION_STYLE enumeration defines the styles of partitions.
type PartitionStyle uint16
var (
// VDS_PST_UNKNOWN: The partition format is unknown.
PartitionStyleUnknown PartitionStyle = 0
// VDS_PST_MBR: The partition format is master boot record (MBR).
PartitionStyleMBR PartitionStyle = 1
// VDS_PST_GPT: The partition format is GUID partitioning table (GPT).
PartitionStyleGPT PartitionStyle = 2
)
func (o PartitionStyle) String() string {
switch o {
case PartitionStyleUnknown:
return "PartitionStyleUnknown"
case PartitionStyleMBR:
return "PartitionStyleMBR"
case PartitionStyleGPT:
return "PartitionStyleGPT"
}
return "Invalid"
}
// PartitionFlag type represents VDS_PARTITION_FLAG RPC enumeration.
//
// The VDS_PARTITION_FLAG enumeration defines flags that describe partitions. A value
// that accepts these flags MUST have the following flag set or MUST have the value
// set to 0 if the flag is not applicable to a given partition.
type PartitionFlag uint16
var (
// VDS_PTF_SYSTEM: Value that indicates that the partition is a system partition.
PartitionFlagSystem PartitionFlag = 1
)
func (o PartitionFlag) String() string {
switch o {
case PartitionFlagSystem:
return "PartitionFlagSystem"
}
return "Invalid"
}
// VolumeType type represents VDS_VOLUME_TYPE RPC enumeration.
//
// The VDS_VOLUME_TYPE enumeration defines the set of valid types for a volume object.
type VolumeType uint16
var (
// VDS_VT_UNKNOWN: The status of the volume is unknown.
VolumeTypeUnknown VolumeType = 0
// VDS_VT_SIMPLE: The volume type is simple: it is composed of extents from exactly
// one disk.
VolumeTypeSimple VolumeType = 10
// VDS_VT_SPAN: The volume type is spanned: it is composed of extents from more than
// one disk.
VolumeTypeSpan VolumeType = 11
// VDS_VT_STRIPE: The volume type is striped, which is equivalent to RAID-0.
VolumeTypeStripe VolumeType = 12
// VDS_VT_MIRROR: The volume type is mirrored, which is equivalent to RAID-1.
VolumeTypeMirror VolumeType = 13
// VDS_VT_PARITY: The volume type is striped with parity, which accounts for RAID
// levels 3, 4, 5, and 6.
VolumeTypeParity VolumeType = 14
)
func (o VolumeType) String() string {
switch o {
case VolumeTypeUnknown:
return "VolumeTypeUnknown"
case VolumeTypeSimple:
return "VolumeTypeSimple"
case VolumeTypeSpan:
return "VolumeTypeSpan"
case VolumeTypeStripe:
return "VolumeTypeStripe"
case VolumeTypeMirror:
return "VolumeTypeMirror"
case VolumeTypeParity:
return "VolumeTypeParity"
}
return "Invalid"
}
// TransitionState type represents VDS_TRANSITION_STATE RPC enumeration.
//
// The VDS_TRANSITION_STATE enumeration defines the set of valid transition state values
// for a VDS object.
type TransitionState uint16
var (
// VDS_TS_UNKNOWN: The transition state of the object cannot be determined.
TransitionStateUnknown TransitionState = 0
// VDS_TS_STABLE: The object is stable. No configuration activity is currently in
// progress.
TransitionStateStable TransitionState = 1
// VDS_TS_EXTENDING: The object is being extended.
TransitionStateExtending TransitionState = 2
// VDS_TS_SHRINKING: The object is being shrunk.
TransitionStateShrinking TransitionState = 3
// VDS_TS_RECONFIGING: The object is being automatically reconfigured.
TransitionStateReconfiging TransitionState = 4
)
func (o TransitionState) String() string {
switch o {
case TransitionStateUnknown:
return "TransitionStateUnknown"
case TransitionStateStable:
return "TransitionStateStable"
case TransitionStateExtending:
return "TransitionStateExtending"
case TransitionStateShrinking: