Previously we have configure blob snapshot to backup virtual disk on Azure. Blob Snapshot did not backup the VM configuration. To do so, we need to use Export-AzureVM cmdlet.
[ Configuration ]
Get azure vm list and identify your virtual machine service name and name.
Backup VM Configuration file and store at your local computer either when VM in power off state or running state.
Export-AzureVM –ServiceName “VM Service Name” –Name “VM Name” –Path E:\vmname.xml |
[XML result]
<?xml version="1.0" encoding="utf-8"?> <PersistentVM xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <ConfigurationSets> <ConfigurationSet xsi:type="NetworkConfigurationSet"> <ConfigurationSetType>NetworkConfiguration</ConfigurationSetType> <InputEndpoints> <InputEndpoint> <LocalPort>5986</LocalPort> <Name>PowerShell</Name> <Port>5986</Port> <Protocol>tcp</Protocol> <EnableDirectServerReturn>false</EnableDirectServerReturn> <IdleTimeoutInMinutes xsi:nil="true" /> </InputEndpoint> <InputEndpoint> <LocalPort>3389</LocalPort> <Name>Remote Desktop</Name> <Port>64669</Port> <Protocol>tcp</Protocol> <EnableDirectServerReturn>false</EnableDirectServerReturn> <IdleTimeoutInMinutes xsi:nil="true" /> </InputEndpoint> </InputEndpoints> <SubnetNames> <string>App</string> </SubnetNames> <PublicIPs /> <NetworkInterfaces /> </ConfigurationSet> </ConfigurationSets> <DataVirtualHardDisks /> <OSVirtualHardDisk> <HostCaching>ReadWrite</HostCaching> <DiskLabel>disk_vmware-vm1_00_os.vhd</DiskLabel> <DiskName>disk_vmware-vm1_00_os.vhd</DiskName> <OS>Windows</OS> <IOType>Standard</IOType> </OSVirtualHardDisk> <RoleName>TestBackup01</RoleName> <RoleSize>Basic_A1</RoleSize> <RoleType>PersistentVMRole</RoleType> <NoExportPrivateKey>false</NoExportPrivateKey> <NoRDPEndpoint>false</NoRDPEndpoint> <NoSSHEndpoint>false</NoSSHEndpoint> <ProvisionGuestAgent>true</ProvisionGuestAgent> <ResourceExtensionReferences> <ResourceExtensionReference> <ReferenceName>BGInfo</ReferenceName> <Publisher>Microsoft.Compute</Publisher> <Name>BGInfo</Name> <Version>1.*</Version> <ResourceExtensionParameterValues /> <State>Enable</State> </ResourceExtensionReference> </ResourceExtensionReferences> </PersistentVM> |
Do keep the XML file in safe location and may come handy when restoration. Stay tuned for our next post about virtual disk restoration and configuration file
More information:-