Memungkinkan Anda untuk mencadangkan ulang semua disk ( termasuk disk data ) dalam instans set skala VM. Operasi ini hanya didukung untuk disk terkelola.
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/reimageall?api-version=2022-03-01
Parameter URI
Name
In
Required
Type
Description
instanceId
path
True
string
ID instans komputer virtual.
resourceGroupName
path
True
string
Nama grup sumber daya.
subscriptionId
path
True
string
Kredensial langganan yang secara unik mengidentifikasi langganan Microsoft Azure. ID langganan membentuk bagian dari URI untuk setiap panggilan layanan.
POST https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/virtualMachineScaleSets/aaaaaaaaaaaaaaaaaaaaaaaa/virtualMachines/aaaaaaaaaaaaaaaaaaa/reimageall?api-version=2022-03-01
import com.azure.core.util.Context;
/** Samples for VirtualMachineScaleSetVMs ReimageAll. */
public final class Main {
/*
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMs_ReimageAll_MaximumSet_Gen.json
*/
/**
* Sample code: VirtualMachineScaleSetVMs_ReimageAll_MaximumSet_Gen.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void virtualMachineScaleSetVMsReimageAllMaximumSetGen(
com.azure.resourcemanager.AzureResourceManager azure) {
azure
.virtualMachines()
.manager()
.serviceClient()
.getVirtualMachineScaleSetVMs()
.reimageAll("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaa", Context.NONE);
}
}
Read this SDK documentation on how to add the SDK to your project and authenticate.
package armcompute_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v3"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMs_ReimageAll_MaximumSet_Gen.json
func ExampleVirtualMachineScaleSetVMsClient_BeginReimageAll() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armcompute.NewVirtualMachineScaleSetVMsClient("{subscription-id}", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginReimageAll(ctx,
"rgcompute",
"aaaaaaaaaaaaaaaaaaaaaaaa",
"aaaaaaaaaaaaaaaaaaa",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}
Read this SDK documentation on how to add the SDK to your project and authenticate.
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks.
*
* @summary Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMs_ReimageAll_MaximumSet_Gen.json
*/
async function virtualMachineScaleSetVMSReimageAllMaximumSetGen() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "rgcompute";
const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa";
const instanceId = "aaaaaaaaaaaaaaaaaaa";
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.virtualMachineScaleSetVMs.beginReimageAllAndWait(
resourceGroupName,
vmScaleSetName,
instanceId
);
console.log(result);
}
virtualMachineScaleSetVMSReimageAllMaximumSetGen().catch(console.error);
Read this SDK documentation on how to add the SDK to your project and authenticate.
POST https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/virtualMachineScaleSets/aaaaaaaaaaaaaaaaaaaaaaaaa/virtualMachines/aaaaaaaaaaaaaaaaaaaaaaaaaaaa/reimageall?api-version=2022-03-01
import com.azure.core.util.Context;
/** Samples for VirtualMachineScaleSetVMs ReimageAll. */
public final class Main {
/*
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMs_ReimageAll_MinimumSet_Gen.json
*/
/**
* Sample code: VirtualMachineScaleSetVMs_ReimageAll_MinimumSet_Gen.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void virtualMachineScaleSetVMsReimageAllMinimumSetGen(
com.azure.resourcemanager.AzureResourceManager azure) {
azure
.virtualMachines()
.manager()
.serviceClient()
.getVirtualMachineScaleSetVMs()
.reimageAll("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", Context.NONE);
}
}
Read this SDK documentation on how to add the SDK to your project and authenticate.
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks.
*
* @summary Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMs_ReimageAll_MinimumSet_Gen.json
*/
async function virtualMachineScaleSetVMSReimageAllMinimumSetGen() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "rgcompute";
const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaa";
const instanceId = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa";
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.virtualMachineScaleSetVMs.beginReimageAllAndWait(
resourceGroupName,
vmScaleSetName,
instanceId
);
console.log(result);
}
virtualMachineScaleSetVMSReimageAllMinimumSetGen().catch(console.error);
Read this SDK documentation on how to add the SDK to your project and authenticate.