Add-AzureDataDisk
데이터 디스크를 가상 머신에 추가합니다.
참고
이 설명서에서 참조하는 cmdlet은 Service Management API를 사용하는 레거시 Azure 리소스를 관리하기 위한 것입니다. Azure Resource Manager 리소스를 관리하는 cmdlet은 Az PowerShell 모듈을 참조하세요.
Syntax
Add-AzureDataDisk
[-CreateNew]
[-DiskSizeInGB] <Int32>
[-DiskLabel] <String>
[-LUN] <Int32>
[-MediaLocation <String>]
[-HostCaching <String>]
-VM <IPersistentVM>
[-Profile <AzureSMProfile>]
[-InformationAction <ActionPreference>]
[-InformationVariable <String>]
[<CommonParameters>]
Add-AzureDataDisk
[-Import]
[-DiskName] <String>
[-LUN] <Int32>
[-HostCaching <String>]
-VM <IPersistentVM>
[-Profile <AzureSMProfile>]
[-InformationAction <ActionPreference>]
[-InformationVariable <String>]
[<CommonParameters>]
Add-AzureDataDisk
[-ImportFrom]
[-DiskLabel] <String>
[-LUN] <Int32>
-MediaLocation <String>
[-HostCaching <String>]
-VM <IPersistentVM>
[-Profile <AzureSMProfile>]
[-InformationAction <ActionPreference>]
[-InformationVariable <String>]
[<CommonParameters>]
Description
Add-AzureDataDisk cmdlet은 Azure 가상 머신 개체에 새 데이터 디스크 또는 기존 데이터 디스크를 추가합니다. CreateNew 매개 변수를 사용하여 지정된 크기와 레이블이 있는 새 데이터 디스크를 만듭니다. Import 매개 변수를 사용하여 이미지 리포지토리에서 기존 디스크를 연결합니다. ImportFrom 매개 변수를 사용하여 스토리지 계정의 Blob에서 기존 디스크를 연결합니다. 연결된 데이터 디스크의 호스트 캐시 모드를 지정할 수 있습니다.
예제
예제 1: 리포지토리에서 데이터 디스크 가져오기
PS C:\> Get-AzureVM "ContosoService" -Name "VirtualMachine07" | Add-AzureDataDisk -Import -DiskName "Disk68" -LUN 0 | Update-AzureVM
이 명령은 Get-AzureVM cmdlet을 사용하여 ContosoService 클라우드 서비스에서 VirtualMachine07이라는 가상 머신에 대한 가상 머신 개체를 가져옵니다. 이 명령은 파이프라인 연산자를 사용하여 현재 cmdlet에 전달합니다. 이 명령은 리포지토리의 기존 데이터 디스크를 가상 머신에 연결합니다. 데이터 디스크의 LUN은 0입니다. 이 명령은 Update-AzureVM cmdlet을 사용하여 변경 내용을 반영하도록 가상 머신을 업데이트합니다.
예제 2: 새 데이터 디스크 추가
PS C:\> Get-AzureVM "ContosoService" -Name "VirtualMachine08" | Add-AzureDataDisk -CreateNew -DiskSizeInGB 128 -DiskLabel "main" -LUN 0 | Update-AzureVM
이 명령은 VirtualMachine08이라는 가상 머신에 대한 가상 머신 개체를 가져옵니다. 명령은 현재 cmdlet에 전달합니다. 이 명령은 MyNewDisk.vhd라는 새 데이터 디스크를 연결합니다. cmdlet은 현재 구독의 기본 스토리지 계정에 vhds 컨테이너에 디스크를 만듭니다. 이 명령은 변경 내용을 반영하도록 가상 머신을 업데이트합니다.
예제 3: 지정된 위치에서 데이터 디스크 추가
PS C:\> Get-AzureVM "ContosoService" -Name "Database" | Add-AzureDataDisk -ImportFrom -MediaLocation "https://contosostorage.blob.core.windows.net/container07/Disk14.vhd" -DiskLabel "main" -LUN 0 | Update-AzureVM
이 명령은 Database라는 가상 머신에 대한 가상 머신 개체를 가져옵니다. 명령은 현재 cmdlet에 전달합니다. 이 명령은 지정된 위치에서 Disk14.vhd라는 기존 데이터 디스크를 연결합니다. 이 명령은 변경 내용을 반영하도록 가상 머신을 업데이트합니다.
매개 변수
-CreateNew
이 cmdlet은 데이터 디스크를 만듭니다.
Type: | SwitchParameter |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DiskLabel
새 데이터 디스크의 디스크 레이블을 지정합니다.
Type: | String |
Position: | 2 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DiskName
디스크 리포지토리에 있는 데이터 디스크의 이름을 지정합니다.
Type: | String |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-DiskSizeInGB
새 데이터 디스크의 논리 디스크 크기를 기가바이트 단위로 지정합니다.
Type: | Int32 |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-HostCaching
디스크의 호스트 수준 캐싱 설정을 지정합니다. 유효한 값은 다음과 같습니다.
- 없음
- 읽기 전용
- ReadWrite
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Import
이 cmdlet은 이미지 리포지토리에서 기존 데이터 디스크를 가져옵니다.
Type: | SwitchParameter |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ImportFrom
이 cmdlet은 스토리지 계정의 Blob에서 기존 데이터 디스크를 가져옵니다.
Type: | SwitchParameter |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-InformationAction
이 cmdlet이 정보 이벤트에 응답하는 방법을 지정합니다.
이 매개 변수에 허용되는 값은 다음과 같습니다.
- 계속
- 무시
- 문의
- SilentlyContinue
- Stop
- 일시 중단
Type: | ActionPreference |
Aliases: | infa |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-InformationVariable
정보 변수를 지정합니다.
Type: | String |
Aliases: | iv |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-LUN
가상 머신의 데이터 드라이브에 대한 LUN(논리 단위 번호)을 지정합니다. 유효한 값은 0~15입니다. 각 데이터 디스크에는 고유한 LUN이 있어야 합니다.
Type: | Int32 |
Position: | 3 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-MediaLocation
이 cmdlet이 데이터 디스크를 저장하는 Azure Storage 계정의 Blob 위치를 지정합니다. 위치를 지정하지 않으면 cmdlet은 현재 구독에 대한 기본 스토리지 계정의 vhds 컨테이너에 데이터 디스크를 저장합니다. vhds 컨테이너가 없으면 cmdlet은 vhds 컨테이너를 만듭니다.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Profile
이 cmdlet이 읽는 Azure 프로필을 지정합니다. 프로필을 지정하지 않으면 이 cmdlet은 로컬 기본 프로필에서 읽습니다.
Type: | AzureSMProfile |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VM
이 cmdlet이 데이터 디스크를 연결하는 가상 머신 개체를 지정합니다. 가상 머신 개체를 가져오려면 Get-AzureVM cmdlet을 사용합니다.
Type: | IPersistentVM |
Aliases: | InputObject |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |