VMware Global Community
Sousuke0614
Enthusiast
Enthusiast
Jump to solution

PowerCLIでのクロスvCentervMotionがvSphere single sign-on failed for connectionで失敗する。

解決事例があればご教示お願いいたします。

移行元 :vCenter6.5

     ESXi6.5

移行先 :vCenter6.7

                  ESXi6.7

クロスvCentervMotionをpowerCLIから実行すると以下エラーで6.5→6.7vCenter環境へ仮想マシンの

移行がうまくいきません。

・PowerCLIから両vCenterへのネットワーク疎通確認(実行コマンド①、②問題なく動作)

・single sign-onドメインは移行元、移行先インストール時vsphere.local で作成済み。

■エラー内容

Move-VM : 2020/10/22 15:00:00   Move-VM         vSphere single sign-on failed for connection '/VIServer=vsphere.local\ad

ministra

tor@vCenterFQDDN:443/' during a previous operation. The current operation requires such single sign-on

and therefore failed. Future operations which require single sign-on on this connection will fail. The underlying cause

was available in the error message which initially reported the single sign-on failure.

発生場所 行:1 文字:40

+ ... me testikou2 | Move-VM -Destination $hv -Datastore $ds -PortGroup $pg

+                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Move-VM], SsoNotAuthenticatedException

    + FullyQualifiedErrorId : VICore_SsoExceptionCausedByEarlierSsoFailure,VMware.VimAutomation.ViCore.Cmdlets.Command

   s.MoveVM

■実行コマンド

①$vc_a = Connect-VIServer 移行元vCenterFQDN

②$vc_b = Connect-VIServer 移行先vCenterFQDN

③$ds = Get-Datastore -Server $vc_b -Name "datastore1"

④$pg = Get-vDPortgroup -Server $vc_b -Name "DPortGroup1"

⑤$hv = Get-VMHost -Server $vc_b -Name "ESXi1"

⑥et-VM -Server $vc_a -Name testikou2 | Move-VM -Destination $hv -Datastore $ds -PortGroup $pg

何卒、宜しくお願い申し上げます。

1 Solution

Accepted Solutions
nkaneda
Enthusiast
Enthusiast
Jump to solution

Two-SSO環境のX vCenter vMotionの場合ですと、PowerCLIで実施する際は両方のvCenterに別々にログインしておく必要があります。

以下のブログが参考になるかもしれません。

naoyuki kaneda's Blog: 【VxRail】既存環境からvSAN 環境へのM... |VMware Communities

シリーズになっているので第3回目の記事のあたりです。

View solution in original post

0 Kudos
4 Replies
nkaneda
Enthusiast
Enthusiast
Jump to solution

Two-SSO環境のX vCenter vMotionの場合ですと、PowerCLIで実施する際は両方のvCenterに別々にログインしておく必要があります。

以下のブログが参考になるかもしれません。

naoyuki kaneda's Blog: 【VxRail】既存環境からvSAN 環境へのM... |VMware Communities

シリーズになっているので第3回目の記事のあたりです。

0 Kudos
kawaman
Leadership
Leadership
Jump to solution

手元の環境は双方 7.0u1 に更新してしまったので試されたバージョン間での挙動確認はしていませんが、

ほぼ同等の手順での移行は問題なく動作しています。

いくつかエラーメッセージで VMTN 内を調べてみると、PowerCLI のバージョンが関連する場合もありそうです。

私は最新に近い Ver 12.0 で試しています。

私の環境では問題なくできましたが、①② の操作後、セッションが切れてしまっている可能性もあるので、

nkaneda さんが指摘されたように変数に入れるのではなく、セッションを張った状態を維持しておくのも切り分けとしてアリかなと思います。

PowerCLI 12.0.0 build 15947286

PS C:\> $cre1 = Get-Credential

PS C:\> $tvc = Connect-VIServer -Server vxvc01.vx.local -Credential $cre1 -Force    # target vCenter 7.0u1

PS C:\> $cre2 = Get-Credential

PS C:\> $svc = Connect-VIServer -Server dvc.dvsan.local -Credential $cre2 -Force    # source vCenter 7.0u1

PS C:\> $vm = Get-vm -Server $svc -Name "Perf-VM01"

PS C:\> $tds = Get-Datastore -Server $tvc -Name "vSAN-Datastore"

PS C:\> $tpg = Get-VDPortgroup -Server $tvc -Name "VM_Network"

PS C:\> $thost = (Get-VMHost -Server $tvc)[0]

PS C:\> Move-VM -VM $vm -Destination $thost -Datastore $tds -PortGroup $tpg

pcli.png

ご参考まで

Sousuke0614
Enthusiast
Enthusiast
Jump to solution

ご回答ありがとうございます。

ブログの通りのコマンドで実施し、うまくいきました。

ご教示ありがとうございました。

0 Kudos
Sousuke0614
Enthusiast
Enthusiast
Jump to solution

ご回答ありがとうございます。

6.5→6.7だとセッション維持が重要かもしれません。

nkanedaさんの指摘どおりセッションを張った状態を維持でうまくいきました。

ためしに7.0→7.0でkawamanさんのコマンドの通り実施した際、正常に動作いたしました。

環境を随時アップグレードしていくので、7..0環境で行う際はご教示頂いた方法を活用させていただきます。

ありがとうございました。

0 Kudos