Linux command
az-image 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Create a managed image
az image create --name [MyImage] --resource-group [MyResourceGroup] --source [MyVM]
Create an image
az image create --name [MyImage] --resource-group [MyResourceGroup] --os-disk [disk-id] --os-type [Linux]
List all images
az image list --resource-group [MyResourceGroup]
Show details
az image show --name [MyImage] --resource-group [MyResourceGroup]
Update image tags
az image update --name [MyImage] --resource-group [MyResourceGroup] --tags [env=prod]
Delete an image
az image delete --name [MyImage] --resource-group [MyResourceGroup]
说明
az image manages custom virtual machine images in Azure. Custom images can be created from generalized VMs, managed disks, or snapshots. These images can then be used to create new VMs with your custom configuration. Custom images are different from marketplace images (managed via az vm image) as they contain your specific software and configurations.
参数
- --name -n
- The name of the image.
- --resource-group -g
- Name of resource group.
- --source
- Source VM, managed disk, or snapshot to create the image from.
- --os-disk
- Source managed disk for OS disk.
- --os-type
- Operating system type: Linux or Windows.
- --location -l
- Location for the image.
- --hyper-v-generation
- Hypervisor generation of the VM: V1 or V2.
- --tags
- Space-separated tags: key=value.
- --data-disk-sources
- Managed disks or snapshots for data disks.
FAQ
What is the az-image command used for?
az image manages custom virtual machine images in Azure. Custom images can be created from generalized VMs, managed disks, or snapshots. These images can then be used to create new VMs with your custom configuration. Custom images are different from marketplace images (managed via az vm image) as they contain your specific software and configurations.
How do I run a basic az-image example?
Run `az image create --name [MyImage] --resource-group [MyResourceGroup] --source [MyVM]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --name -n do in az-image?
The name of the image.