18. • 標準虛擬機器
• 只有作業系統環境,其他的由系統管理人員安
裝與設定。
• 以標準虛擬機器方式計費。
• 在虛擬機器上所安裝的軟體的授權由系統管理
員負責。
• 例如安裝 Team Foundation Server 時,需先
取得正版的 Team Foundation Server 授權。
• 應用型虛擬機器
• SQL Server
• BizTalk Server
• 評估版軟體
• 價格內含授權費用,不需額外付費。
• 預覽版軟體計費方式與標準虛擬機器相同。
• Windows Server 2012 R2 Preview
• Visual Studio Ultimate 2013 Preview
• SQL Server 2014 Preview
22. DEPOT VM
• VM DEPOT 是 Microsoft Azure 特別為 Linux 社群提供的作業系統範本交
流工具。
• 內容由社群提供,亦可自行建置範本後上傳到 VM DEPOT 平台。
• 使用者可瀏覽 VM DEPOT 範本以產生影像。
• 隨後即可用影像產生虛擬機器。
http://vmdepot.msopentech.com/List/Index
33. First Virtual Machine in a NEW Cloud Service (-Location specified)
New-AzureQuickVM -Windows -ServiceName $svc -Name $vm1 -ImageName
$wimg -Location $location -Password $pwd
New Virtual Machine in an Existing Cloud Service (no –Location)
New-AzureQuickVM -Windows -ServiceName $svc -Name $vm2 -ImageName
$wimg -Password $pwd
Creating a Linux Virtual Machine in an Existing Cloud Service
New-AzureQuickVM -Linux -ServiceName $svc -Name $vm3 -ImageName $limg
-LinuxUser $lu -Password $pwd
40. Retrieve Cloud Services
Get-AzureService
Retrieve Virtual Machines for Service
Get-AzureVM -ServiceName $cloudSvcName
Retrieve Status for All VMs in Subsription
Get-AzureService | foreach {
$_ | Get-AzureVM | ft ServiceName, Name, InstanceStatus
}
41.
42. • 終端點 (Endpoint) 是虛擬機器與外部聯繫的入口。
• 遠端桌面 (TCP Port 3389)
• HTTP (TCP Port 80)
• SQL Server (TCP 1433)
• 終端點是設定在 Windows Azure 的交換器與防火牆上。
• 虛擬機器的作業系統若沒有打開防火牆埠號時仍然無法存取。
• 作業系統若有打開但沒設定終端點時,只有資料中心內的服務與內部網路可
存取。
43. • 終端點與 Windows 防火牆的終端點不同。
• 預設會開啟 Port 3389,但對外的埠會以亂數設定。
• 終端點提供了駭客的攻擊面。
• 若沒必要開的終端點應予關閉 (刪除)。
• 例如:遠端桌面不用時應刪除,需要時再打開即可。
57. New Virtual Machine Creation with Data Disk
New-AzureVMConfig -Name 'myvm1' -InstanceSize 'Small' -ImageName $img |
Add-AzureProvisioningConfig -Windows -Password $pwd |
Add-AzureDataDisk -CreateNew -DiskSizeInGB 10 -DiskLabel 'myddisk' -LUN 0 |
New-AzureVM -ServiceName $cloudSvcName
Add new Data Disk to existing Virtual Machine
Get-AzureVM -ServiceName 'myvm1' |
Add-AzureDataDisk -CreateNew -DiskSizeInGB 10 -DiskLabel 'myddisk' -LUN 1 |
Update-AzureVM
58. Set Host Caching on OS Disk During Provisioning
New-AzureVMConfig -Name 'myvm1' -InstanceSize 'Small' -ImageName $img |
Add-AzureProvisioningConfig -Windows -Password $pwd |
Set-AzureOSDisk -HostCaching 'ReadOnly' |
New-AzureVM -ServiceDescription $cloudSvcName
Set Host Caching on Existing Data Disk in running VM
Get-AzureVM -ServiceName $cloudSvcName -Name 'myvm1' |
Set-AzureDataDisk -HostCaching 'ReadWrite' -LUN 0 |
Update-AzureVM
61. Remove RDP and Add New Storage Across all Web Front Ends
Get-AzureVM -ServiceName $svc | Where { $_.Name -match 'wfe' } | foreach {
$_ |
Remove-AzureEndpoint -Name 'rdp' |
Add-AzureDataDisk -CreateNew -DiskSizeInGB 10 -LUN 1 -DiskLabel 'newstorage' |
Update-AzureVM
}
62. Capture Sys-Prepped VM into a new Image (Deletes the Source VM)
Save-AzureVMImage -ServiceName $cloudSvcName -Name 'myvm1'
-NewImageName 'Image Name'
Slide Objectives:Explain how to setup a subscription Notes:The .publishsettings file contains your subscription information, the service endpoint, subscription name and certificate. Once downloaded the Import-AzurePublishSettingsFilecmdlet will install the certificate and configure your PowerShell environment.
Slide Objectives:Use this method if you want to specify a certificate that you have created on your own.
Slide Objectives:Explain where subscription settings are persistedNotes:The subscription XML file supports multiple subscriptions. You can use a single PowerShell session to administer VMs and services across all of your configured subscriptions.
Slide Objectives:Explain how to switch contexts when scripting against multiple subscriptionsNotes:Get-AzureSubscription returns all configured subscriptions and Select-AzureSubscription sets the current subscription
Slide Objectives:Explain how to set the current storage account that the cmdlets will use.Notes:Certaincmdlets like New-AzureVM or New-AzureQuickVM require the user to specify the storage account to use. Since each subscription can contain multiple storage accounts the property name to set is CurrentStorageAccount. This allows you to easily change the storage account for the next operation.
Slide Objectives:To create a VM you either need to start with an Image or Disk and specify the location where to place the VM.
Slide Objectives:Show three examples that show a key component of using the cmdlets.Notes:When you specify -Location or -AffinityGroupthe cmdlets will attempt to create a new cloud service to deploy the VM to. If you do not specify either the cmdlets assume the cloud service exists in the current subscription.
Slide Objectives:With PowerShell you can configure various settings in a batchNotes:New New-AzureVMConfig and New-AzureVM to allow a batched creation of a VM. New-AzureVMConfig returns a configuration object that is then passed to other cmdlets to modify via the PowerShell pipeline.Finally, it is passed to New-AzureVM where the VM is created with all of the configuration specified.
Slide Objectives:It is also possible to create multiple configuration objects for multiple VMs and pass them to the New-AzureVMcmdlet as an array.
Slide Objectives:Another example of batch VM creation: using an array/loop to create multiple VMs
Slide Objectives:Explain other common settings used to provision a VM
Slide Objectives:The Add-AzureProvisioningConfigcmdlet supports two parameter sets for Windows.Notes:-Windows allows just setting the password of the VM on boot.-WindowsDomain allows you to specify all of the settings necessary to have the VM join the domain on boot. This scenario only works in a VNET environment where the DNS specified knows how to have the VM find the domain controller.-DisableAutomaticUpdates allows for disabling automatic updates by default. Available to both parameter sets.-NoRDPEndpoint does not create the RDP endpoint on creation. Of course you can add this later through PS or the Portal.-TimeZone allows you to specify the VMs timezone on provisioning. -Certificates allows you to automatically install certificates on the VM on provisioning. Note: the certificates must already be installed in the cloud service. For an example: http://michaelwasham.com/2012/08/23/deploying-certificates-with-windows-azure-virtual-machines-and-powershell/
Slide Objectives:The Add-AzureProvisioningConfigcmdlet supports one parameter set for LinuxNotes:The Linux parameter set requires specifying the user name and also allows for disabling SSH on the Linux VM or just not adding the SSH endpoint. Additionally, you can deploy SSH certificates as long as they are already in the cloud service.
Slide Objectives:Show different methods of discovering virtual machines
Slide Objectives:Explain storage options
Slide Objectives:Show examples of configuring storage Notes:The first example creates a new VM with a 10GB disk attached.The second example gets an existing VM, adds a 10GB disk to it and updates it live.
Slide Objectives:Explain disk caching defaults and how to modify itNotes:By default OS disks have read / write caching enabled and data disks have no caching. You can use Set-AzureOSDisk or Set-AzureDataDisk to modify these settings at run time. Set-AzureOSDisk requires a reboot.
Slide Objectives:Demonstrate how to configure network endpoints on a VM
Slide Objectives:Numerous examples that show how to filer output from the disk and image repository.
Slide Objectives:Show how you can iterate through a list of VMs (like all VMs that have a name starting with wfe and perform an update such as adding a new disk and removing an endpoint.
Slide Objectives:Show how to capture a VM
Slide Objectives:Operations allowed from PowerShell for updating an modifying VNET Settings.
Slide Objectives:Deploying into a Virtual Network requires multiple settings.Notes:When configuring the VM you must specify the subnet using the Set-AzureSubnetcmdlet. You can only specify the VNET and DNS settings for a cloud service on the creation of the first VM. If you add a second VM to the cloud service it will inherit the networking settings.