Azure 가상 머신 라이브러리Azure virtual machine libraries

개요Overview

Linux 또는 Windows를 실행하는 요청 시 확장 가능한 컴퓨팅 리소스입니다.On-demand, scalable computing resources running Linux or Windows.

Azure Virtual Machines를 시작하려면 Azure Portal을 사용하여 Linux 가상 머신 만들기를 참조하세요.To get started with Azure Virtual Machines, see Create a Linux virtual machine with the Azure portal.

관리 APIManagement API

관리 API를 사용하여 코드에서 Azure의 Windows 및 Linux 가상 머신을 생성, 구성, 관리 및 크기 조정할 수 있습니다.Create, configure, manage and scale Windows and Linux virtual machines in Azure from your code with the management API.

pip를 통해 라이브러리를 설치합니다.Install the library via pip.

pip install azure-mgmt-compute

Example

관리되는 서비스 ID(MSI) 인증을 사용하여 기존 Azure 리소스 그룹에 새 Linux 가상 컴퓨터를 만듭니다.Create a new Linux virtual machine in an existing Azure resource group with Managed Service Identity(MSI) authentication.

VM_PARAMETERS={
        'location': 'LOCATION',
        'os_profile': {
            'computer_name': 'VM_NAME',
            'admin_username': 'USERNAME',
            'admin_password': 'PASSWORD'
        },
        'hardware_profile': {
            'vm_size': 'Standard_DS1_v2'
        },
        'storage_profile': {
            'image_reference': {
                'publisher': 'Canonical',
                'offer': 'UbuntuServer',
                'sku': '16.04.0-LTS',
                'version': 'latest'
            },
        },
        'network_profile': {
            'network_interfaces': [{
                'id': 'NIC_ID',
            }]
        },
    }

def create_vm()
    compute_client.virtual_machines.create_or_update(
        'RESOURCE_GROUP_NAME', 'VM_NAME', VM_PARAMETERS)

샘플Samples

가상 머신 샘플의 전체 목록을 봅니다.View the complete list of virtual machine samples.