---
title: "validateBlockDeviceIdentifier(_:)"
framework: virtualization
role: symbol
role_heading: Type Method
path: "virtualization/vzvirtioblockdeviceconfiguration/validateblockdeviceidentifier(_:)"
---

# validateBlockDeviceIdentifier(_:)

Checks the validity of a block device identifier.

## Declaration

```swift
class func validateBlockDeviceIdentifier(_ blockDeviceIdentifier: String) throws
```

## Parameters

- `blockDeviceIdentifier`: The device identifier to validate. In the case of an invalid identifier string, the method throws an error that describes why the device identifier isn’t valid.

## Discussion

Discussion Use validateBlockDeviceIdentifier(_:) to validate an identifier string before trying to set the blockDeviceIdentifier property. The identifier must be an ASCII encodable string of 20 bytes or less.
