0
(0)

[IT] SCVMM で新しいバーチャルマシンを作成するスクリプト

  SCVMMで【バーチャルマシン】設定プロパティとして、仮想ネットワークインタフェイス、仮想CPU種別(コア数)、ディスクサイズ、BIOS条件、IDEデバイス、バーチャルマシン値(管理名)、所有者値(AD管理者)、宛先ライブラリサーバ値(FQDN名)、パス値(UNCフルパス値)をを GUI 上から設定し、『スクリプトの表示』を押下すると作成されます。

[code lang=”php”]

# ——————————————————————————
# 新しいバーチャル マシン スクリプト
# ——————————————————————————
# 2010年11月9日 10:59:59 で Virtual Machine Manager によって生成されたスクリプト
#
# コマンドレットの使用法の追加のヘルプについては、「get-help <コマンドレット名>」と入力してください
# ——————————————————————————
New-VirtualNetworkAdapter -VMMServer localhost -JobGroup xxxxxxxx-2a15-4623-8af1-e900fbca4d82 -PhysicalAddressType Dynamic -VLanEnabled $false -MACAddressesSpoofingEnabled $false
New-VirtualDVDDrive -VMMServer localhost -JobGroup xxxxxxxx-2a15-4623-8af1-e900fbca4d82 -Bus 0 -LUN 1

$CPUType = Get-CPUType -VMMServer localhost | where {$_.Name -eq "2.80 GHz Pentium D (dual core)"}
New-HardwareProfile -VMMServer localhost -Owner "xxxxxxxxAdministrator" -CPUType $CPUType -Name "プロファイルxxxxxxxx-833f-4343-8d01-d14c0ab6cdc1" -Description "VM/テンプレートの作成に使用される一時ハードウェア構成" -CPUCount 2 -MemoryMB 1024 -RelativeWeight 100 -HighlyAvaixxxxxxxxle $false -NumLock $false -BootOrder "CD", "IdeHardDrive", "PxeBoot", "Floppy" -LimitCPUFunctionality $false -LimitCPUForMigration $false -JobGroup xxxxxxxx-2a15-4623-8af1-e900fbca4d82

New-VirtualDiskDrive -VMMServer localhost -IDE -Bus 0 -LUN 0 -JobGroup xxxxxxxx-2a15-4623-8af1-e900fbca4d82 -Size 40960 -Dynamic -Filename "CentOS5.5-1_disk_1"

$LibraryServer = Get-LibraryServer -VMMServer localhost | where {$_.Name -eq "xxxxxxxx.fxfrog.com"}
$HardwareProfile = Get-HardwareProfile -VMMServer localhost | where {$_.Name -eq "プロファイルxxxxxxxx-833f-4343-8d01-d14c0ab6cdc1"}

New-VM -VMMServer localhost -Name "CentOS5.5-1" -Description "" -Owner "xxxxxxxxAdministrator" -LibraryServer $LibraryServer -SharePath "<a href="file://\xxxxxxxx.fxfrog.comMSSCVMMLibraryVHDs">\xxxxxxxx.fxfrog.comMSSCVMMLibraryVHDs</a>" -HardwareProfile $HardwareProfile -JobGroup xxxxxxxx-2a15-4623-8af1-e900fbca4d82 -RunAsynchronously -RunAsSystem -StartAction NeverAutoTurnOnVM -StopAction SaveVM

[/code]
※ 外部攻撃を避けるために、特定個所のみ xxxxxxxx というダミー文字列へ置換済み。

作成されたスクリプトをオリジンコードとし、軽微変更を生じたときやライブラリを他の環境へ移行する際に役立つので GUI で作成したライブラリであっても何らかのスクリプトファイルとして保存しておくと役立つかもしれませんし、管理が煩雑になる可能性もあるので運用環境に合わせてご利用ください。
以上

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

投稿者 斉藤之雄 (Yukio Saito)

Global Information and Communication Technology OTAKU / Sports volunteer / Social Services / Master of Technology in Innovation for Design and Engineering, AIIT / BA, Social Welfare, NFU / twitter@yukio_saitoh