6장. Azure에 RHEL AI 설치
Azure에 Red Hat Enterprise Linux AI를 설치하고 배포할 수 있는 방법은 여러 가지가 있습니다.
- Azure Marketplace 에서 RHEL AI를 구매할 수 있습니다.
- RHEL AI 다운로드 페이지에서 RHEL AI VHD를 다운로드 하여 Azure 이미지로 변환할 수 있습니다.
VHD를 사용하여 Azure에 Red Hat Enterprise Linux AI를 설치하고 배포하려면 먼저 RHEL AI 이미지를 Azure 이미지로 변환해야 합니다. 그런 다음 Azure 이미지를 사용하여 인스턴스를 시작하고 Azure 머신에 RHEL AI를 배포할 수 있습니다.
6.1. RHEL AI 이미지를 Azure 이미지로 변환 링크 복사링크가 클립보드에 복사되었습니다!
Azure에서 부팅 가능한 이미지를 생성하려면 Azure 계정을 구성하고 Azure Storage 컨테이너를 생성하고 RHEL AI VHD 이미지를 사용하여 Azure 이미지를 생성해야 합니다.
사전 요구 사항
- 특정 머신에 Azure CLI를 설치했습니다. Azure CLI 설치에 대한 자세한 내용은 Linux에 Azure CLI 설치를 참조하십시오.
- 특정 시스템에 AzCopy를 설치했습니다. AzCopy 설치에 대한 자세한 내용은 Linux에 AzCopy 설치를 참조하십시오.
프로세스
다음 명령을 실행하여 Azure에 로그인합니다.
$ az login로그인 출력 예
$ az login A web browser has been opened at https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize. Please continue the login in the web browser. If no web browser is available or if the web browser fails to open, use device code flow with `az login --use-device-code`. [ { "cloudName": "AzureCloud", "homeTenantId": "c7b976df-89ce-42ec-b3b2-a6b35fd9c0be", "id": "79d7df51-39ec-48b9-a15e-dcf59043c84e", "isDefault": true, "managedByTenants": [], "name": "Team Name", "state": "Enabled", "tenantId": "0a873aea-428f-47bd-9120-73ce0c5cc1da", "user": { "name": "user@example.com", "type": "user" } } ]다음 명령을 사용하여
azcopy도구로 로그인합니다.$ keyctl new_session $ azcopy loginAzure 이미지를 생성하기 전에 다양한 Azure 구성을 설정하고 Azure Storage 컨테이너를 생성해야 합니다.
다음 명령을 사용하여 인스턴스의 위치를 정의하는 환경 변수를 생성합니다.
$ az_location=eastus리소스 그룹을 생성하고
az_resource_group이라는 환경 변수에 이름을 저장합니다. 다음 예제에서는eastus위치에Default라는 리소스 그룹을 생성합니다. (기존 리소스 그룹을 사용하려는 경우 이 단계를 생략할 수 있습니다.)$ az_resource_group=Default $ az group create --name ${az_resource_group} --location ${az_location}Azure 스토리지 계정을 생성하고 다음 명령을 실행하여
az_storage_account라는 환경 변수에 이름을 저장합니다.$ az_storage_account=THE_NAME_OF_YOUR_STORAGE_ACCOUNT$ az storage account create \ --name ${az_storage_account} \ --resource-group ${az_resource_group} \ --location ${az_location} \ --sku Standard_LRS다음 명령을 사용하여 이름이
az_storage_container인 Azure Storage 컨테이너를 생성합니다.$ az_storage_container=NAME_OF_MY_BUCKET $ az storage container create \ --name ${az_storage_container} \ --account-name ${az_storage_account} \ --public-access off다음 명령을 실행하여 Azure 계정 목록에서 서브스크립션 ID를 가져올 수 있습니다.
$ az account list --output table서브스크립션 ID를 사용하여 ' az_subscription_id'라는 변수를 생성합니다.
$ az_subscription_id=46c08fb3-83c5-4b59-8372-bf9caf15a681사용자에게 스토리지 컨테이너에
azcopy쓰기 권한을 부여합니다. 이 예제에서는user@example.com사용자에게 권한을 부여합니다.$ az role assignment create \ --assignee user@example.com \ --role "Storage Blob Data Contributor" \ --scope /subscriptions/${az_subscription_id}/resourceGroups/${az_resource_group}/providers/Microsoft.Storage/storageAccounts/${az_storage_account}/blobServices/default/containers/${az_storage_container}
- 이제 Azure 스토리지 컨테이너가 설정되었으므로 Red Hat Enterprise Linux AI 다운로드 페이지에서 Azure VHD 이미지를 다운로드해야 합니다.
다음 명령을 사용하여
vhd.gz파일의 압축을 풉니다.$ gunzip <downloaded-azure-gz-image>RHEL AI Azure 이미지로 사용할 이름을 설정합니다.
$ image_name=rhel-ai-1.5다음 명령을 실행하여 VHD 파일을 Azure Storage 컨테이너에 업로드합니다.
$ az_vhd_url="https://${az_storage_account}.blob.core.windows.net/${az_storage_container}/$(basename ${vhd_file})" $ azcopy copy "$vhd_file" "$az_vhd_url"다음 명령으로 방금 업로드한 VHD 파일에서 Azure 이미지를 생성합니다.
$ az image create --resource-group $az_resource_group \ --name "$image_name" \ --source "${az_vhd_url}" \ --location ${az_location} \ --os-type Linux \ --hyper-v-generation V2