Azureの小ネタ (改)

~Azureネタを中心に、色々とその他の技術的なことなどを~

Azure Websites 上のPowerShell バージョン

Azure Websites (← Webサイトから変わったんすね)の PowerShell バージョンは、

PS D:\home> $psversiontable
Name                           Value                                           
----                           -----                                           
PSVersion                      3.0                                             
WSManStackVersion              3.0                                             
SerializationVersion           1.1.0.1                                         
CLRVersion                     4.0.30319.36213                                 
BuildVersion                   6.2.9200.16628                                  
PSCompatibleVersions           {1.0, 2.0, 3.0}                                 
PSRemotingProtocolVersion      2.2                      

でした。

で、所用でKuduのPSコンソール上から、Invoke-WebRequest を呼び出したら、

Invoke-WebRequest : The response content cannot be parsed because the Internet Explorer engine is not available, or Internet Explorer's first-launch configuration is not complete. Specify the UseBasicParsing parameter and try again.

IE云々で使えねーておこられました。”UseBasicParsing” オプション付けろといつので、付けてみたのですが、

Invoke-WebRequest : Win32 internal error "The handle is invalid" 0x6 occurred while reading the console output buffer. Contact Microsoft Customer Support Services.

って怒られて詰みました。curl つかうか....

追記

ってなツイートがあったため試してみたところ無事うごきました。

Azure 仮想マシンのDNS固定化

Azureでは 仮想マシン作成時にDNSを固定化できます。(VNETでも指定できますが、個別にも指定できます)

$Dns = New-AzureDns -Name "localhost" -IPAddress "127.0.0.7"
...
New-AzureVM -ServiceName $ServiceName -VNetName $AzureVN -VMs $VMConfig -DnsSettings $Dns -Verbose

一見すると仮想マシン毎に指定できそうですが、同一クラウドサービスにもう1つ仮想マシンをDNSを指定して作成てようとすると、警告がでます。

警告: VNetName, DnsSettings, DeploymentLabel or DeploymentName Name can only be specified on new deployments.

で、実際作成したときの例。

f:id:StateMachine:20150108154401p:plain

というわけで、DNS固定化はクラウドサービス単位だったんですねという小ネタ。VM作成時に指定できるから、てっきりと思ってましたが。

参考URL

New-AzureDns 以外にも Get/Set/Remove/Add などありますが、使ったことないです。

以上

Azure VMでHPC Pack 入りの イメージギャラリーを使ったらハマった

Azure VM のイメージギャラリーにHPCパック入りが用意されていたので、試していたんですが、 Azureノードテンプレート作成部分でハマっのでメモ。

ヘッドノードからAzureサブスクリプションにアクセスできるよう、サブスクリプションIDと証明書を指定するのですが、証明書はデフォルトでHPC Packが用意してくれてます。

Requirements to Add Azure Nodes with Microsoft HPC Pack からの引用。

Use the Default Microsoft HPC Azure Management certificate that is generated automatically on the head node when HPC Pack is installed. This certificate is self-signed and unique to your installation of HPC Pack on the head node. This certificate is intended only for testing purposes and proof-of-concept deployments. This certificate file is located in the following location on the head node computer: %CCP_HOME%\bin\hpccert.cer.

hpccert.cer が用意されていて、証明書ストアにも入っているのでコレを使うと楽チンです。対象のAzureサブスクリプションに管理ポータルにアップロードしておけばOKなんですが、何度やっても以下のエラーがでる。

f:id:StateMachine:20141212134042p:plain

なんかこの時期のSSL絡みのエラーなんで、例の脆弱性がからんでいるかと思っていろいろやってみましたが、解決しませんでした。

結局、自分で証明書を作り、ストアに入れ、管理ポータルにもアップしてやってみたら、ちゃんと認識しました。

といわけで、hpcceret が使えない原因は分かってません。