| 1 |
#!/usr/bin/python |
| 2 |
# -*- coding: utf-8 -*- |
| 3 |
|
| 4 |
# Copyright: (c) 2017, Marc Tschapek <[email protected]> |
| 5 |
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) |
| 6 |
|
| 7 |
DOCUMENTATION = r''' |
| 8 |
--- |
| 9 |
module: win_disk_facts |
| 10 |
short_description: Show the attached disks and disk information of the target host |
| 11 |
description: |
| 12 |
- With the module you can retrieve and output detailed information about the attached disks of the target and |
| 13 |
its volumes and partitions if existent. |
| 14 |
requirements: |
| 15 |
- Windows 8.1 / Windows 2012 (NT 6.2) |
| 16 |
notes: |
| 17 |
- In order to understand all the returned properties and values please visit the following site and open the respective MSFT class |
| 18 |
U(https://msdn.microsoft.com/en-us/library/windows/desktop/hh830612.aspx) |
| 19 |
author: |
| 20 |
- Marc Tschapek (@marqelme) |
| 21 |
options: |
| 22 |
filter: |
| 23 |
description: |
| 24 |
- Allows to filter returned facts by type of disk information. |
| 25 |
- If volumes are selected partitions will be returned as well. |
| 26 |
type: list |
| 27 |
elements: str |
| 28 |
choices: [ physical_disk, virtual_disk, win32_disk_drive, partitions, volumes ] |
| 29 |
default: [ physical_disk, virtual_disk, win32_disk_drive, partitions, volumes ] |
| 30 |
version_added: 1.9.0 |
| 31 |
''' |
| 32 |
|
| 33 |
EXAMPLES = r''' |
| 34 |
- name: Get disk facts |
| 35 |
community.windows.win_disk_facts: |
| 36 |
|
| 37 |
- name: Output first disk size |
| 38 |
debug: |
| 39 |
var: ansible_facts.disks[0].size |
| 40 |
|
| 41 |
- name: Convert first system disk into various formats |
| 42 |
debug: |
| 43 |
msg: '{{ disksize_gib }} vs {{ disksize_gib_human }}' |
| 44 |
vars: |
| 45 |
# Get first system disk |
| 46 |
disk: '{{ ansible_facts.disks|selectattr("system_disk")|first }}' |
| 47 |
|
| 48 |
# Show disk size in Gibibytes |
| 49 |
disksize_gib_human: '{{ disk.size|filesizeformat(true) }}' # returns "223.6 GiB" (human readable) |
| 50 |
disksize_gib: '{{ (disk.size/1024|pow(3))|round|int }} GiB' # returns "224 GiB" (value in GiB) |
| 51 |
|
| 52 |
# Show disk size in Gigabytes |
| 53 |
disksize_gb_human: '{{ disk.size|filesizeformat }}' # returns "240.1 GB" (human readable) |
| 54 |
disksize_gb: '{{ (disk.size/1000|pow(3))|round|int }} GB' # returns "240 GB" (value in GB) |
| 55 |
|
| 56 |
- name: Output second disk serial number |
| 57 |
debug: |
| 58 |
var: ansible_facts.disks[1].serial_number |
| 59 |
|
| 60 |
- name: get disk physical_disk and partition facts on the target |
| 61 |
win_disk_facts: |
| 62 |
filter: |
| 63 |
- physical_disk |
| 64 |
- partitions |
| 65 |
''' |
| 66 |
|
| 67 |
RETURN = r''' |
| 68 |
ansible_facts: |
| 69 |
description: Dictionary containing all the detailed information about the disks of the target. |
| 70 |
returned: always |
| 71 |
type: complex |
| 72 |
contains: |
| 73 |
ansible_disks: |
| 74 |
description: Detailed information about one particular disk. |
| 75 |
returned: if disks were found |
| 76 |
type: list |
| 77 |
contains: |
| 78 |
number: |
| 79 |
description: Disk number of the particular disk. |
| 80 |
returned: always |
| 81 |
type: int |
| 82 |
sample: 0 |
| 83 |
size: |
| 84 |
description: Size in bytes of the particular disk. |
| 85 |
returned: always |
| 86 |
type: int |
| 87 |
sample: 227727638528 |
| 88 |
bus_type: |
| 89 |
description: Bus type of the particular disk. |
| 90 |
returned: always |
| 91 |
type: str |
| 92 |
sample: "SCSI" |
| 93 |
friendly_name: |
| 94 |
description: Friendly name of the particular disk. |
| 95 |
returned: always |
| 96 |
type: str |
| 97 |
sample: "Red Hat VirtIO SCSI Disk Device" |
| 98 |
partition_style: |
| 99 |
description: Partition style of the particular disk. |
| 100 |
returned: always |
| 101 |
type: str |
| 102 |
sample: "MBR" |
| 103 |
partition_count: |
| 104 |
description: Number of partitions on the particular disk. |
| 105 |
returned: always |
| 106 |
type: int |
| 107 |
sample: 4 |
| 108 |
operational_status: |
| 109 |
description: Operational status of the particular disk. |
| 110 |
returned: always |
| 111 |
type: str |
| 112 |
sample: "Online" |
| 113 |
sector_size: |
| 114 |
description: Sector size in bytes of the particular disk. |
| 115 |
returned: always |
| 116 |
type: int |
| 117 |
sample: 4096 |
| 118 |
read_only: |
| 119 |
description: Read only status of the particular disk. |
| 120 |
returned: always |
| 121 |
type: bool |
| 122 |
sample: true |
| 123 |
bootable: |
| 124 |
description: Information whether the particular disk is a bootable disk. |
| 125 |
returned: always |
| 126 |
type: bool |
| 127 |
sample: false |
| 128 |
system_disk: |
| 129 |
description: Information whether the particular disk is a system disk. |
| 130 |
returned: always |
| 131 |
type: bool |
| 132 |
sample: true |
| 133 |
clustered: |
| 134 |
description: Information whether the particular disk is clustered (part of a failover cluster). |
| 135 |
returned: always |
| 136 |
type: bool |
| 137 |
sample: false |
| 138 |
manufacturer: |
| 139 |
description: Manufacturer of the particular disk. |
| 140 |
returned: always |
| 141 |
type: str |
| 142 |
sample: "Red Hat" |
| 143 |
model: |
| 144 |
description: Model specification of the particular disk. |
| 145 |
returned: always |
| 146 |
type: str |
| 147 |
sample: "VirtIO" |
| 148 |
firmware_version: |
| 149 |
description: Firmware version of the particular disk. |
| 150 |
returned: always |
| 151 |
type: str |
| 152 |
sample: "0001" |
| 153 |
location: |
| 154 |
description: Location of the particular disk on the target. |
| 155 |
returned: always |
| 156 |
type: str |
| 157 |
sample: "PCIROOT(0)#PCI(0400)#SCSI(P00T00L00)" |
| 158 |
serial_number: |
| 159 |
description: Serial number of the particular disk on the target. |
| 160 |
returned: always |
| 161 |
type: str |
| 162 |
sample: "b62beac80c3645e5877f" |
| 163 |
unique_id: |
| 164 |
description: Unique ID of the particular disk on the target. |
| 165 |
returned: always |
| 166 |
type: str |
| 167 |
sample: "3141463431303031" |
| 168 |
guid: |
| 169 |
description: GUID of the particular disk on the target. |
| 170 |
returned: if existent |
| 171 |
type: str |
| 172 |
sample: "{efa5f928-57b9-47fc-ae3e-902e85fbe77f}" |
| 173 |
path: |
| 174 |
description: Path of the particular disk on the target. |
| 175 |
returned: always |
| 176 |
type: str |
| 177 |
sample: "\\\\?\\scsi#disk&ven_red_hat&prod_virtio#4&23208fd0&1&000000#{<id>}" |
| 178 |
partitions: |
| 179 |
description: Detailed information about one particular partition on the specified disk. |
| 180 |
returned: if existent |
| 181 |
type: list |
| 182 |
contains: |
| 183 |
number: |
| 184 |
description: Number of the particular partition. |
| 185 |
returned: always |
| 186 |
type: int |
| 187 |
sample: 1 |
| 188 |
size: |
| 189 |
description: |
| 190 |
- Size in bytes of the particular partition. |
| 191 |
returned: always |
| 192 |
type: int |
| 193 |
sample: 838860800 |
| 194 |
type: |
| 195 |
description: Type of the particular partition. |
| 196 |
returned: always |
| 197 |
type: str |
| 198 |
sample: "IFS" |
| 199 |
gpt_type: |
| 200 |
description: gpt type of the particular partition. |
| 201 |
returned: if partition_style property of the particular disk has value "GPT" |
| 202 |
type: str |
| 203 |
sample: "{e3c9e316-0b5c-4db8-817d-f92df00215ae}" |
| 204 |
no_default_driveletter: |
| 205 |
description: Information whether the particular partition has a default drive letter or not. |
| 206 |
returned: if partition_style property of the particular disk has value "GPT" |
| 207 |
type: bool |
| 208 |
sample: true |
| 209 |
mbr_type: |
| 210 |
description: mbr type of the particular partition. |
| 211 |
returned: if partition_style property of the particular disk has value "MBR" |
| 212 |
type: int |
| 213 |
sample: 7 |
| 214 |
active: |
| 215 |
description: Information whether the particular partition is an active partition or not. |
| 216 |
returned: if partition_style property of the particular disk has value "MBR" |
| 217 |
type: bool |
| 218 |
sample: true |
| 219 |
drive_letter: |
| 220 |
description: Drive letter of the particular partition. |
| 221 |
returned: if existent |
| 222 |
type: str |
| 223 |
sample: "C" |
| 224 |
transition_state: |
| 225 |
description: Transition state of the particular partition. |
| 226 |
returned: always |
| 227 |
type: int |
| 228 |
sample: 1 |
| 229 |
offset: |
| 230 |
description: Offset of the particular partition. |
| 231 |
returned: always |
| 232 |
type: int |
| 233 |
sample: 368050176 |
| 234 |
hidden: |
| 235 |
description: Information whether the particular partition is hidden or not. |
| 236 |
returned: always |
| 237 |
type: bool |
| 238 |
sample: true |
| 239 |
shadow_copy: |
| 240 |
description: Information whether the particular partition is a shadow copy of another partition. |
| 241 |
returned: always |
| 242 |
type: bool |
| 243 |
sample: false |
| 244 |
guid: |
| 245 |
description: GUID of the particular partition. |
| 246 |
returned: if existent |
| 247 |
type: str |
| 248 |
sample: "{302e475c-6e64-4674-a8e2-2f1c7018bf97}" |
| 249 |
access_paths: |
| 250 |
description: Access paths of the particular partition. |
| 251 |
returned: if existent |
| 252 |
type: str |
| 253 |
sample: "\\\\?\\Volume{85bdc4a8-f8eb-11e6-80fa-806e6f6e6963}\\" |
| 254 |
volumes: |
| 255 |
description: Detailed information about one particular volume on the specified partition. |
| 256 |
returned: if existent |
| 257 |
type: list |
| 258 |
contains: |
| 259 |
size: |
| 260 |
description: |
| 261 |
- Size in bytes of the particular volume. |
| 262 |
returned: always |
| 263 |
type: int |
| 264 |
sample: 838856704 |
| 265 |
size_remaining: |
| 266 |
description: |
| 267 |
- Remaining size in bytes of the particular volume. |
| 268 |
returned: always |
| 269 |
type: int |
| 270 |
sample: 395620352 |
| 271 |
type: |
| 272 |
description: File system type of the particular volume. |
| 273 |
returned: always |
| 274 |
type: str |
| 275 |
sample: "NTFS" |
| 276 |
label: |
| 277 |
description: File system label of the particular volume. |
| 278 |
returned: always |
| 279 |
type: str |
| 280 |
sample: "System Reserved" |
| 281 |
health_status: |
| 282 |
description: Health status of the particular volume. |
| 283 |
returned: always |
| 284 |
type: str |
| 285 |
sample: "Healthy" |
| 286 |
drive_type: |
| 287 |
description: Drive type of the particular volume. |
| 288 |
returned: always |
| 289 |
type: str |
| 290 |
sample: "Fixed" |
| 291 |
allocation_unit_size: |
| 292 |
description: Allocation unit size in bytes of the particular volume. |
| 293 |
returned: always |
| 294 |
type: int |
| 295 |
sample: 4096 |
| 296 |
object_id: |
| 297 |
description: Object ID of the particular volume. |
| 298 |
returned: always |
| 299 |
type: str |
| 300 |
sample: "\\\\?\\Volume{85bdc4a9-f8eb-11e6-80fa-806e6f6e6963}\\" |
| 301 |
path: |
| 302 |
description: Path of the particular volume. |
| 303 |
returned: always |
| 304 |
type: str |
| 305 |
sample: "\\\\?\\Volume{85bdc4a9-f8eb-11e6-80fa-806e6f6e6963}\\" |
| 306 |
physical_disk: |
| 307 |
description: Detailed information about physical disk properties of the particular disk. |
| 308 |
returned: if existent |
| 309 |
type: complex |
| 310 |
contains: |
| 311 |
media_type: |
| 312 |
description: Media type of the particular physical disk. |
| 313 |
returned: always |
| 314 |
type: str |
| 315 |
sample: "UnSpecified" |
| 316 |
size: |
| 317 |
description: |
| 318 |
- Size in bytes of the particular physical disk. |
| 319 |
returned: always |
| 320 |
type: int |
| 321 |
sample: 240057409536 |
| 322 |
allocated_size: |
| 323 |
description: |
| 324 |
- Allocated size in bytes of the particular physical disk. |
| 325 |
returned: always |
| 326 |
type: int |
| 327 |
sample: 240057409536 |
| 328 |
device_id: |
| 329 |
description: Device ID of the particular physical disk. |
| 330 |
returned: always |
| 331 |
type: str |
| 332 |
sample: "0" |
| 333 |
friendly_name: |
| 334 |
description: Friendly name of the particular physical disk. |
| 335 |
returned: always |
| 336 |
type: str |
| 337 |
sample: "PhysicalDisk0" |
| 338 |
operational_status: |
| 339 |
description: Operational status of the particular physical disk. |
| 340 |
returned: always |
| 341 |
type: str |
| 342 |
sample: "OK" |
| 343 |
health_status: |
| 344 |
description: Health status of the particular physical disk. |
| 345 |
returned: always |
| 346 |
type: str |
| 347 |
sample: "Healthy" |
| 348 |
bus_type: |
| 349 |
description: Bus type of the particular physical disk. |
| 350 |
returned: always |
| 351 |
type: str |
| 352 |
sample: "SCSI" |
| 353 |
usage_type: |
| 354 |
description: Usage type of the particular physical disk. |
| 355 |
returned: always |
| 356 |
type: str |
| 357 |
sample: "Auto-Select" |
| 358 |
supported_usages: |
| 359 |
description: Supported usage types of the particular physical disk. |
| 360 |
returned: always |
| 361 |
type: complex |
| 362 |
contains: |
| 363 |
Count: |
| 364 |
description: Count of supported usage types. |
| 365 |
returned: always |
| 366 |
type: int |
| 367 |
sample: 5 |
| 368 |
value: |
| 369 |
description: List of supported usage types. |
| 370 |
returned: always |
| 371 |
type: str |
| 372 |
sample: "Auto-Select, Hot Spare" |
| 373 |
spindle_speed: |
| 374 |
description: Spindle speed in rpm of the particular physical disk. |
| 375 |
returned: always |
| 376 |
type: int |
| 377 |
sample: 4294967295 |
| 378 |
physical_location: |
| 379 |
description: Physical location of the particular physical disk. |
| 380 |
returned: always |
| 381 |
type: str |
| 382 |
sample: "Integrated : Adapter 3 : Port 0 : Target 0 : LUN 0" |
| 383 |
manufacturer: |
| 384 |
description: Manufacturer of the particular physical disk. |
| 385 |
returned: always |
| 386 |
type: str |
| 387 |
sample: "SUSE" |
| 388 |
model: |
| 389 |
description: Model of the particular physical disk. |
| 390 |
returned: always |
| 391 |
type: str |
| 392 |
sample: "Xen Block" |
| 393 |
can_pool: |
| 394 |
description: Information whether the particular physical disk can be added to a storage pool. |
| 395 |
returned: always |
| 396 |
type: bool |
| 397 |
sample: false |
| 398 |
cannot_pool_reason: |
| 399 |
description: Information why the particular physical disk can not be added to a storage pool. |
| 400 |
returned: if can_pool property has value false |
| 401 |
type: str |
| 402 |
sample: "Insufficient Capacity" |
| 403 |
indication_enabled: |
| 404 |
description: Information whether indication is enabled for the particular physical disk. |
| 405 |
returned: always |
| 406 |
type: bool |
| 407 |
sample: true |
| 408 |
partial: |
| 409 |
description: Information whether the particular physical disk is partial. |
| 410 |
returned: always |
| 411 |
type: bool |
| 412 |
sample: false |
| 413 |
serial_number: |
| 414 |
description: Serial number of the particular physical disk. |
| 415 |
returned: always |
| 416 |
type: str |
| 417 |
sample: "b62beac80c3645e5877f" |
| 418 |
object_id: |
| 419 |
description: Object ID of the particular physical disk. |
| 420 |
returned: always |
| 421 |
type: str |
| 422 |
sample: '{1}\\\\HOST\\root/Microsoft/Windows/Storage/Providers_v2\\SPACES_PhysicalDisk.ObjectId=\"{<object_id>}:PD:{<pd>}\"' |
| 423 |
unique_id: |
| 424 |
description: Unique ID of the particular physical disk. |
| 425 |
returned: always |
| 426 |
type: str |
| 427 |
sample: "3141463431303031" |
| 428 |
virtual_disk: |
| 429 |
description: Detailed information about virtual disk properties of the particular disk. |
| 430 |
returned: if existent |
| 431 |
type: complex |
| 432 |
contains: |
| 433 |
size: |
| 434 |
description: |
| 435 |
- Size in bytes of the particular virtual disk. |
| 436 |
returned: always |
| 437 |
type: int |
| 438 |
sample: 240057409536 |
| 439 |
allocated_size: |
| 440 |
description: |
| 441 |
- Allocated size in bytes of the particular virtual disk. |
| 442 |
returned: always |
| 443 |
type: int |
| 444 |
sample: 240057409536 |
| 445 |
footprint_on_pool: |
| 446 |
description: |
| 447 |
- Footprint on pool in bytes of the particular virtual disk. |
| 448 |
returned: always |
| 449 |
type: int |
| 450 |
sample: 240057409536 |
| 451 |
name: |
| 452 |
description: Name of the particular virtual disk. |
| 453 |
returned: always |
| 454 |
type: str |
| 455 |
sample: "vDisk1" |
| 456 |
friendly_name: |
| 457 |
description: Friendly name of the particular virtual disk. |
| 458 |
returned: always |
| 459 |
type: str |
| 460 |
sample: "Prod2 Virtual Disk" |
| 461 |
operational_status: |
| 462 |
description: Operational status of the particular virtual disk. |
| 463 |
returned: always |
| 464 |
type: str |
| 465 |
sample: "OK" |
| 466 |
health_status: |
| 467 |
description: Health status of the particular virtual disk. |
| 468 |
returned: always |
| 469 |
type: str |
| 470 |
sample: "Healthy" |
| 471 |
provisioning_type: |
| 472 |
description: Provisioning type of the particular virtual disk. |
| 473 |
returned: always |
| 474 |
type: str |
| 475 |
sample: "Thin" |
| 476 |
allocation_unit_size: |
| 477 |
description: Allocation unit size in bytes of the particular virtual disk. |
| 478 |
returned: always |
| 479 |
type: int |
| 480 |
sample: 4096 |
| 481 |
media_type: |
| 482 |
description: Media type of the particular virtual disk. |
| 483 |
returned: always |
| 484 |
type: str |
| 485 |
sample: "Unspecified" |
| 486 |
parity_layout: |
| 487 |
description: Parity layout of the particular virtual disk. |
| 488 |
returned: if existent |
| 489 |
type: int |
| 490 |
sample: 1 |
| 491 |
access: |
| 492 |
description: Access of the particular virtual disk. |
| 493 |
returned: always |
| 494 |
type: str |
| 495 |
sample: "Read/Write" |
| 496 |
detached_reason: |
| 497 |
description: Detached reason of the particular virtual disk. |
| 498 |
returned: always |
| 499 |
type: str |
| 500 |
sample: "None" |
| 501 |
write_cache_size: |
| 502 |
description: Write cache size in byte of the particular virtual disk. |
| 503 |
returned: always |
| 504 |
type: int |
| 505 |
sample: 100 |
| 506 |
fault_domain_awareness: |
| 507 |
description: Fault domain awareness of the particular virtual disk. |
| 508 |
returned: always |
| 509 |
type: str |
| 510 |
sample: "PhysicalDisk" |
| 511 |
inter_leave: |
| 512 |
description: |
| 513 |
- Inter leave in bytes of the particular virtual disk. |
| 514 |
returned: always |
| 515 |
type: int |
| 516 |
sample: 102400 |
| 517 |
deduplication_enabled: |
| 518 |
description: Information whether deduplication is enabled for the particular virtual disk. |
| 519 |
returned: always |
| 520 |
type: bool |
| 521 |
sample: true |
| 522 |
enclosure_aware: |
| 523 |
description: Information whether the particular virtual disk is enclosure aware. |
| 524 |
returned: always |
| 525 |
type: bool |
| 526 |
sample: false |
| 527 |
manual_attach: |
| 528 |
description: Information whether the particular virtual disk is manual attached. |
| 529 |
returned: always |
| 530 |
type: bool |
| 531 |
sample: true |
| 532 |
snapshot: |
| 533 |
description: Information whether the particular virtual disk is a snapshot. |
| 534 |
returned: always |
| 535 |
type: bool |
| 536 |
sample: false |
| 537 |
tiered: |
| 538 |
description: Information whether the particular virtual disk is tiered. |
| 539 |
returned: always |
| 540 |
type: bool |
| 541 |
sample: true |
| 542 |
physical_sector_size: |
| 543 |
description: Physical sector size in bytes of the particular virtual disk. |
| 544 |
returned: always |
| 545 |
type: int |
| 546 |
sample: 4096 |
| 547 |
logical_sector_size: |
| 548 |
description: Logical sector size in byte of the particular virtual disk. |
| 549 |
returned: always |
| 550 |
type: int |
| 551 |
sample: 512 |
| 552 |
available_copies: |
| 553 |
description: Number of the available copies of the particular virtual disk. |
| 554 |
returned: if existent |
| 555 |
type: int |
| 556 |
sample: 1 |
| 557 |
columns: |
| 558 |
description: Number of the columns of the particular virtual disk. |
| 559 |
returned: always |
| 560 |
type: int |
| 561 |
sample: 2 |
| 562 |
groups: |
| 563 |
description: Number of the groups of the particular virtual disk. |
| 564 |
returned: always |
| 565 |
type: int |
| 566 |
sample: 1 |
| 567 |
physical_disk_redundancy: |
| 568 |
description: Type of the physical disk redundancy of the particular virtual disk. |
| 569 |
returned: always |
| 570 |
type: int |
| 571 |
sample: 1 |
| 572 |
read_cache_size: |
| 573 |
description: Read cache size in byte of the particular virtual disk. |
| 574 |
returned: always |
| 575 |
type: int |
| 576 |
sample: 0 |
| 577 |
request_no_spof: |
| 578 |
description: Information whether the particular virtual disk requests no single point of failure. |
| 579 |
returned: always |
| 580 |
type: bool |
| 581 |
sample: true |
| 582 |
resiliency_setting_name: |
| 583 |
description: Type of the physical disk redundancy of the particular virtual disk. |
| 584 |
returned: always |
| 585 |
type: int |
| 586 |
sample: 1 |
| 587 |
object_id: |
| 588 |
description: Object ID of the particular virtual disk. |
| 589 |
returned: always |
| 590 |
type: str |
| 591 |
sample: '{1}\\\\HOST\\root/Microsoft/Windows/Storage/Providers_v2\\SPACES_VirtualDisk.ObjectId=\"{<object_id>}:VD:{<vd>}\"' |
| 592 |
unique_id: |
| 593 |
description: Unique ID of the particular virtual disk. |
| 594 |
returned: always |
| 595 |
type: str |
| 596 |
sample: "260542E4C6B01D47A8FA7630FD90FFDE" |
| 597 |
unique_id_format: |
| 598 |
description: Unique ID format of the particular virtual disk. |
| 599 |
returned: always |
| 600 |
type: str |
| 601 |
sample: "Vendor Specific" |
| 602 |
win32_disk_drive: |
| 603 |
description: Representation of the Win32_DiskDrive class. |
| 604 |
returned: if existent |
| 605 |
type: complex |
| 606 |
contains: |
| 607 |
availability: |
| 608 |
description: Availability and status of the device. |
| 609 |
returned: always |
| 610 |
type: int |
| 611 |
bytes_per_sector: |
| 612 |
description: Number of bytes in each sector for the physical disk drive. |
| 613 |
returned: always |
| 614 |
type: int |
| 615 |
sample: 512 |
| 616 |
capabilities: |
| 617 |
description: |
| 618 |
- Array of capabilities of the media access device. |
| 619 |
- For example, the device may support random access (3), removable media (7), and automatic cleaning (9). |
| 620 |
returned: always |
| 621 |
type: list |
| 622 |
sample: |
| 623 |
- 3 |
| 624 |
- 4 |
| 625 |
capability_descriptions: |
| 626 |
description: |
| 627 |
- List of more detailed explanations for any of the access device features indicated in the Capabilities array. |
| 628 |
- Note, each entry of this array is related to the entry in the Capabilities array that is located at the same index. |
| 629 |
returned: always |
| 630 |
type: list |
| 631 |
sample: |
| 632 |
- Random Access |
| 633 |
- Supports Writing |
| 634 |
caption: |
| 635 |
description: Short description of the object. |
| 636 |
returned: always |
| 637 |
type: str |
| 638 |
sample: VMware Virtual disk SCSI Disk Device |
| 639 |
compression_method: |
| 640 |
description: Algorithm or tool used by the device to support compression. |
| 641 |
returned: always |
| 642 |
type: str |
| 643 |
sample: Compressed |
| 644 |
config_manager_error_code: |
| 645 |
description: Windows Configuration Manager error code. |
| 646 |
returned: always |
| 647 |
type: int |
| 648 |
sample: 0 |
| 649 |
config_manager_user_config: |
| 650 |
description: If True, the device is using a user-defined configuration. |
| 651 |
returned: always |
| 652 |
type: bool |
| 653 |
sample: true |
| 654 |
creation_class_name: |
| 655 |
description: |
| 656 |
- Name of the first concrete class to appear in the inheritance chain used in the creation of an instance. |
| 657 |
- When used with the other key properties of the class, the property allows all instances of this class |
| 658 |
- and its subclasses to be uniquely identified. |
| 659 |
returned: always |
| 660 |
type: str |
| 661 |
sample: Win32_DiskDrive |
| 662 |
default_block_size: |
| 663 |
description: Default block size, in bytes, for this device. |
| 664 |
returned: always |
| 665 |
type: int |
| 666 |
sample: 512 |
| 667 |
description: |
| 668 |
description: Description of the object. |
| 669 |
returned: always |
| 670 |
type: str |
| 671 |
sample: Disk drive |
| 672 |
device_id: |
| 673 |
description: Unique identifier of the disk drive with other devices on the system. |
| 674 |
returned: always |
| 675 |
type: str |
| 676 |
sample: "\\\\.\\PHYSICALDRIVE0" |
| 677 |
error_cleared: |
| 678 |
description: If True, the error reported in LastErrorCode is now cleared. |
| 679 |
returned: always |
| 680 |
type: bool |
| 681 |
sample: true |
| 682 |
error_description: |
| 683 |
description: |
| 684 |
- More information about the error recorded in LastErrorCode, |
| 685 |
- and information on any corrective actions that may be taken. |
| 686 |
returned: always |
| 687 |
type: str |
| 688 |
error_methodology: |
| 689 |
description: Type of error detection and correction supported by this device. |
| 690 |
returned: always |
| 691 |
type: str |
| 692 |
firmware_revision: |
| 693 |
description: Revision for the disk drive firmware that is assigned by the manufacturer. |
| 694 |
returned: always |
| 695 |
type: str |
| 696 |
sample: 1.0 |
| 697 |
index: |
| 698 |
description: |
| 699 |
- Physical drive number of the given drive. |
| 700 |
- This property is filled by the STORAGE_DEVICE_NUMBER structure returned from the IOCTL_STORAGE_GET_DEVICE_NUMBER control code |
| 701 |
- A value of 0xffffffff indicates that the given drive does not map to a physical drive. |
| 702 |
returned: always |
| 703 |
type: int |
| 704 |
sample: 0 |
| 705 |
install_date: |
| 706 |
description: Date and time the object was installed. This property does not need a value to indicate that the object is installed. |
| 707 |
returned: always |
| 708 |
type: str |
| 709 |
interface_type: |
| 710 |
description: Interface type of physical disk drive. |
| 711 |
returned: always |
| 712 |
type: str |
| 713 |
sample: SCSI |
| 714 |
last_error_code: |
| 715 |
description: Last error code reported by the logical device. |
| 716 |
returned: always |
| 717 |
type: int |
| 718 |
manufacturer: |
| 719 |
description: Name of the disk drive manufacturer. |
| 720 |
returned: always |
| 721 |
type: str |
| 722 |
sample: Seagate |
| 723 |
max_block_size: |
| 724 |
description: Maximum block size, in bytes, for media accessed by this device. |
| 725 |
returned: always |
| 726 |
type: int |
| 727 |
max_media_size: |
| 728 |
description: Maximum media size, in kilobytes, of media supported by this device. |
| 729 |
returned: always |
| 730 |
type: int |
| 731 |
media_loaded: |
| 732 |
description: |
| 733 |
- If True, the media for a disk drive is loaded, which means that the device has a readable file system and is accessible. |
| 734 |
- For fixed disk drives, this property will always be TRUE. |
| 735 |
returned: always |
| 736 |
type: bool |
| 737 |
sample: true |
| 738 |
media_type: |
| 739 |
description: Type of media used or accessed by this device. |
| 740 |
returned: always |
| 741 |
type: str |
| 742 |
sample: Fixed hard disk media |
| 743 |
min_block_size: |
| 744 |
description: Minimum block size, in bytes, for media accessed by this device. |
| 745 |
returned: always |
| 746 |
type: int |
| 747 |
model: |
| 748 |
description: Manufacturer's model number of the disk drive. |
| 749 |
returned: always |
| 750 |
type: str |
| 751 |
sample: ST32171W |
| 752 |
name: |
| 753 |
description: Label by which the object is known. When subclassed, the property can be overridden to be a key property. |
| 754 |
returned: always |
| 755 |
type: str |
| 756 |
sample: \\\\.\\PHYSICALDRIVE0 |
| 757 |
needs_cleaning: |
| 758 |
description: |
| 759 |
- If True, the media access device needs cleaning. |
| 760 |
- Whether manual or automatic cleaning is possible is indicated in the Capabilities property. |
| 761 |
returned: always |
| 762 |
type: bool |
| 763 |
number_of_media_supported: |
| 764 |
description: |
| 765 |
- Maximum number of media which can be supported or inserted |
| 766 |
- (when the media access device supports multiple individual media). |
| 767 |
returned: always |
| 768 |
type: int |
| 769 |
partitions: |
| 770 |
description: Number of partitions on this physical disk drive that are recognized by the operating system. |
| 771 |
returned: always |
| 772 |
type: int |
| 773 |
sample: 3 |
| 774 |
pnp_device_id: |
| 775 |
description: Windows Plug and Play device identifier of the logical device. |
| 776 |
returned: always |
| 777 |
type: str |
| 778 |
sample: "SCSI\\DISK&VEN_VMWARE&PROD_VIRTUAL_DISK\\5&1982005&0&000000" |
| 779 |
power_management_capabilities: |
| 780 |
description: Array of the specific power-related capabilities of a logical device. |
| 781 |
returned: always |
| 782 |
type: list |
| 783 |
power_management_supported: |
| 784 |
description: |
| 785 |
- If True, the device can be power-managed (can be put into suspend mode, and so on). |
| 786 |
- The property does not indicate that power management features are currently enabled, |
| 787 |
- only that the logical device is capable of power management. |
| 788 |
returned: always |
| 789 |
type: bool |
| 790 |
scsi_bus: |
| 791 |
description: SCSI bus number of the disk drive. |
| 792 |
returned: always |
| 793 |
type: int |
| 794 |
sample: 0 |
| 795 |
scsi_logical_unit: |
| 796 |
description: SCSI logical unit number (LUN) of the disk drive. |
| 797 |
returned: always |
| 798 |
type: int |
| 799 |
sample: 0 |
| 800 |
scsi_port: |
| 801 |
description: SCSI port number of the disk drive. |
| 802 |
returned: always |
| 803 |
type: int |
| 804 |
sample: 0 |
| 805 |
scsi_target_id: |
| 806 |
description: SCSI identifier number of the disk drive. |
| 807 |
returned: always |
| 808 |
type: int |
| 809 |
sample: 0 |
| 810 |
sectors_per_track: |
| 811 |
description: Number of sectors in each track for this physical disk drive. |
| 812 |
returned: always |
| 813 |
type: int |
| 814 |
sample: 63 |
| 815 |
serial_number: |
| 816 |
description: Number allocated by the manufacturer to identify the physical media. |
| 817 |
returned: always |
| 818 |
type: str |
| 819 |
sample: 6000c298f34101b38cb2b2508926b9de |
| 820 |
signature: |
| 821 |
description: Disk identification. This property can be used to identify a shared resource. |
| 822 |
returned: always |
| 823 |
type: int |
| 824 |
size: |
| 825 |
description: |
| 826 |
- Size of the disk drive. It is calculated by multiplying the total number of cylinders, tracks in each cylinder, |
| 827 |
- sectors in each track, and bytes in each sector. |
| 828 |
returned: always |
| 829 |
type: int |
| 830 |
sample: 53686402560 |
| 831 |
status: |
| 832 |
description: |
| 833 |
- Current status of the object. Various operational and nonoperational statuses can be defined. |
| 834 |
- 'Operational statuses include: "OK", "Degraded", and "Pred Fail"' |
| 835 |
- (an element, such as a SMART-enabled hard disk drive, may be functioning properly but predicting a failure in the near future). |
| 836 |
- 'Nonoperational statuses include: "Error", "Starting", "Stopping", and "Service".' |
| 837 |
- '"Service", could apply during mirror-resilvering of a disk, reload of a user permissions list, or other administrative work.' |
| 838 |
- Not all such work is online, yet the managed element is neither "OK" nor in one of the other states. |
| 839 |
returned: always |
| 840 |
type: str |
| 841 |
sample: OK |
| 842 |
status_info: |
| 843 |
description: |
| 844 |
- State of the logical device. If this property does not apply to the logical device, the value 5 (Not Applicable) should be used. |
| 845 |
returned: always |
| 846 |
type: int |
| 847 |
system_creation_class_name: |
| 848 |
description: Value of the scoping computer's CreationClassName property. |
| 849 |
returned: always |
| 850 |
type: str |
| 851 |
sample: Win32_ComputerSystem |
| 852 |
system_name: |
| 853 |
description: Name of the scoping system. |
| 854 |
returned: always |
| 855 |
type: str |
| 856 |
sample: WILMAR-TEST-123 |
| 857 |
total_cylinders: |
| 858 |
description: |
| 859 |
- Total number of cylinders on the physical disk drive. |
| 860 |
- 'Note: the value for this property is obtained through extended functions of BIOS interrupt 13h.' |
| 861 |
- The value may be inaccurate if the drive uses a translation scheme to support high-capacity disk sizes. |
| 862 |
- Consult the manufacturer for accurate drive specifications. |
| 863 |
returned: always |
| 864 |
type: int |
| 865 |
sample: 6527 |
| 866 |
total_heads: |
| 867 |
description: |
| 868 |
- Total number of heads on the disk drive. |
| 869 |
- 'Note: the value for this property is obtained through extended functions of BIOS interrupt 13h.' |
| 870 |
- The value may be inaccurate if the drive uses a translation scheme to support high-capacity disk sizes. |
| 871 |
- Consult the manufacturer for accurate drive specifications. |
| 872 |
returned: always |
| 873 |
type: int |
| 874 |
sample: 255 |
| 875 |
total_sectors: |
| 876 |
description: |
| 877 |
- Total number of sectors on the physical disk drive. |
| 878 |
- 'Note: the value for this property is obtained through extended functions of BIOS interrupt 13h.' |
| 879 |
- The value may be inaccurate if the drive uses a translation scheme to support high-capacity disk sizes. |
| 880 |
- Consult the manufacturer for accurate drive specifications. |
| 881 |
returned: always |
| 882 |
type: int |
| 883 |
sample: 104856255 |
| 884 |
total_tracks: |
| 885 |
description: |
| 886 |
- Total number of tracks on the physical disk drive. |
| 887 |
- 'Note: the value for this property is obtained through extended functions of BIOS interrupt 13h.' |
| 888 |
- The value may be inaccurate if the drive uses a translation scheme to support high-capacity disk sizes. |
| 889 |
- Consult the manufacturer for accurate drive specifications. |
| 890 |
returned: always |
| 891 |
type: int |
| 892 |
sample: 1664385 |
| 893 |
tracks_per_cylinder: |
| 894 |
description: |
| 895 |
- Number of tracks in each cylinder on the physical disk drive. |
| 896 |
- 'Note: the value for this property is obtained through extended functions of BIOS interrupt 13h.' |
| 897 |
- The value may be inaccurate if the drive uses a translation scheme to support high-capacity disk sizes. |
| 898 |
- Consult the manufacturer for accurate drive specifications. |
| 899 |
returned: always |
| 900 |
type: int |
| 901 |
sample: 255 |
| 902 |
''' |