vagrant ssh でパスワードが通らずprivatekeyを要求される

今までユーザー名:vagrant パスワード:vagrant で入っていたのですが、久しぶりに使ってみたところ秘密鍵private_keyを要求されるようになりました。 まあそりゃあそうでしょう。

vagrant のSSH設定は >vagrant ssh-configで見られます。

Host default
  HostName 127.0.0.1
  User vagrant
  Port 2222
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile C:/Users/hoge/MyVagrant/CentOS7/.vagrant/machines/default/virtualbox/private_key
  IdentitiesOnly yes
  LogLevel FATAL

Windowsの場合、初期状態ではC:/Users/hoge/MyVagrant/CentOS7/.vagrant/machines/default/virtualbox/private_keyみたいな所にあります。

www.vagrantup.com

には "default this is port 22" とまだ書かれていますが。 また「秘密鍵とその置き場所もvagrantの初期設定のままだと安全ではないので自身で安全な場所に自分の秘密鍵を作りましょう」と書かれています。

このあたりの設定の変更も vagarntfileの編集で行います。

Vagrant で rubygems エラー

Vagrantで

C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file
-- vagrant-share/helper/api (LoadError)
    from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'

というようなエラーが出るようになった。ググると数日前から報告されているようです。 私の環境は Widows10Home x64 VirtualBox5.1.20 Vagrant1.9.4 です。

github.com

読んでいったところ

$ vagrant plugin install vagrant-share --plugin-version 1.1.8

で直るよ。とのことだったので、vagrant-share --plugin-version 1.1.8 をインストールし、Vagrant up してみたのですがまた別のエラーが出ました。

C:/HashiCorp/Vagrant/embedded/gems/gems/net-ssh-4.1.0/lib/net/ssh/transport/server_version.rb:54:in `readpartial': An established connection was aborted by the software in your host machine. 
(Errno::ECONNABORTED)
        from C:/HashiCorp/Vagrant/embedded/gems/gems/net-ssh-4.1.0/lib/net/ssh/transport/server_version.rb:54:in `block (2 levels) in negotiate!'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/net-ssh-4.1.0/lib/net/ssh/transport/server_version.rb:52:in `loop'

もう少し読んでいってみたところ、下記に

github.com

Those who want to fix it now in your computer without waiting for 1.9.5 can replace 3 files changed in #8526 in vagrant installation directory.
For example in windows, those files are located in

C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.4/templates/locales/en.yml
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/errors.rb
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.4/plugins/communicators/ssh/communicator.rb
replace them with new en.yml, errors.rb and communicator.rb

Then you are good to go. It worked on my Windows 10 machine. One gotcha is in Windows, you have to change folder permission of the directory to edit or create new files.

と書いてありました。

https://raw.githubusercontent.com/chrisroberts/vagrant/2acded113c8f8915038b6230df1acfac43332c0c/templates/locales/en.yml

https://raw.githubusercontent.com/chrisroberts/vagrant/2acded113c8f8915038b6230df1acfac43332c0c/lib/vagrant/errors.rb

https://raw.githubusercontent.com/chrisroberts/vagrant/2acded113c8f8915038b6230df1acfac43332c0c/plugins/communicators/ssh/communicator.rb

を右クリックしてファイルを3つとも保存し、HashiCorp 以下のそれぞれのディレクトリにある元のファイルを置き換える。これで再度 Vagrant up してもエラーは出なくなった。

github.com

Vagrant 1.9.5 で修正予定のようです。

ML115 G1 に VMware vSphere Hypervisor をインストール

化石や骨董品とまでは言わないけど、もう使ってる人なんてほとんどいないだろうなと思う古い格安サーバー HP ML115 G5がメインマシンでWindows。初代 ML115 G1 がサブ機で、CentOSをインストールして使ってた。

今回サブ機のHDD入れ替えを機に仮想化してみることにする。無料の VMware vSphere Hypervisor ですが。 動作条件としてIntel VTまたはAMD-Vに対応したマルチコアCPU。NICではIntelBroadcomNVIDIAのみ。カニさん(Realtek)はダメ(カスタムドライバ作成で可)。など、いろいろ厳しいけど、ハード要件はなんとかクリア。(ML115G1にOpteron1210)
しかし案の定はまりまくる。ほんと「貧乏だから新しいの買えないから古いので我慢するんだ」とか思ってるけど、費用対効果を考えても作業時間分時給で働いて新しいパソコン買う方が正しいな……。

VMware vSphere Hypervisor (ESXi)

  • 6.0 or 5.5 or 4.1 + Rufus(USBメモリ) ×インストール画面まで進めない。
  • 6.0 or 5.5 or 4.1 + DDforWindows(USBメモリ) ×インストール画面まで進めない。
  • 6.0 5.5 4.1 + syslinux最新版 ×
  • 6.0 5.5 4.1 + syslinux4.04 △boot画面まで進めた。menu.c32: not a COM32R image
  • 6.0 5.5 + syslinux3.72 △インストール画面を通過。その後、CPU AMD Opteron 1210 がサポート外と出る。(というかハードウェア拡張機能AMD-Vが有効になってないよと言われる。Intel-VT,ML115G5環境だとBIOSに設定画面が出るけど、G1には設定画面がない。それでもデフォルトで AMD-Vは有効になるはずなんだけど…)
  • 4.1 + syslinux3.72 △インストール画面を通過。その後、CD-ROMドライブがサポート外の表記。使ってないのに。
  • 4.0 + syslinux3.72 をUSBドライブへインストール 〇インストール完了。その後、パープルスクリーン。
  • HP版 4.1へアップグレードを行ってみる。 ×CD-ROMがサポート外。

VMware vSphere Hypervisor HewlettPackard版

  • 6.0 5.1 4.1(ESXi) + Rufus(USBメモリ) △boot画面まで進めた。menu.c32: not a COM32R image
  • 6.0 5.1 4.1 (ESXi)+ DDforWindows(USBメモリ) △boot画面で menu.c32: not a COM32R image
  • 6.0 5.1 4.1 + syslinux最新版 ×
  • 6.0 5.1 4.1 + syslinux4.04 △boot画面まで進めた。menu.c32: not a COM32R image
  • 6.0 + syslinux3.72 △インストール画面を通過。その後、CPU AMD Opteron 1210 がサポート外。
  • 5.1 + syslinux3.72 △インストール画面を通過。その後、CPU AMD Opteron 1210 がサポート外。
  • 4.1 + syslinux3.72 △インストール画面を通過。その後、HDDがサポート外。
  • 4.1 + syslinux3.72 をUSBドライブへインストール △インストール画面を通過。その後、CD-ROMがサポート外。
  • HP版じゃない方の 4.0 ESXi でインストール完了 〇。その後パープルスクリーン ×。
  • 5.1 + syslinux3.72 でアップグレードインストール。 〇やはりOpteron1210は対象外。だがなぜかインストールは完了した。4.0から設定がうまく引き継がれているということだろうか。以後しばらく様子を見て6.0へのアップグレードも試してみる。

以下詳細。
最新の6.0を(CD-Rドライブがないため)USBメモリからインストールしてみたけどダメ。5.5もダメ。 https://my.vmware.com/jp/web/vmware/evalcenter?p=free-esxi6 https://my.vmware.com/jp/web/vmware/info/slug/datacenter_cloud_infrastructure/vmware_vsphere_hypervisor_esxi/5_0

検索してみるとML115で4.1をインストールしてあるのが幾つか見つかった。
http://blog.pdns.jp/vmware-esxi-4-1-0-vmware-vsphere-hypervisor/ Installing and Running VMware vSphere (ESX 4.0) on your lab HP Proliant ML110 or ML115.
HP ML115にVMware ESXi 4.1をUSBメモリインストール - Symfoware

なのでまず4.1を試す。
本家にはもう置いてないのでググって落とす……。
isoファイルをDVDに焼いて試すのが通常だけど、DVD-ROMしかついてないので焼けない。USBブートを目指す。
技術メモメモ: Shuttle DS81を買ってESXi 6.0をインストールした話② (ESXi Custom Image作成~インストール完了まで)
上記を参考に
Rufus - Create bootable USB drives the easy way
でブータブルUSBドライブを作成

6.0+Rufus 5.5+Rufus 4.1+Rufus 全部ダメ。
Rufas の換わりに DDforWindows でも試してみる。 http://blog.pdns.jp/vmware-esxi-4-1-0-vmware-vsphere-hypervisor/
6.0 5.5 4.1 ダメ。

ドライバとかが合ってないのかもしれないなと思う。
ESXi-Customizerでドライバを組み込んだISOを作成できるんですが、何が必要なのかよく分からない。
自宅ESXi 6.0 小型PC NUC(NUC5i7RYH)に構築 その2:ESXiインストール編 - Qiita

そこでふと思いついたのが、HPやらDELLやらってベンダー独自でドライバを組み込んだISOファイルを配布してたよな?ということ。
ありました。
Hewlett Packard Enterprise
HPE and VMware’s infrastructure as a service solution | Hewlett Packard Enterprise
VMware vSphere Hypervisor 4 (ESXi) and Updates を落として、再度RufasでUSBに書き込みインストールを試してみる。

通った。しかし、boot画面で menu.c32: not a COM32R image と出て進めない。
ESXi インストール from USBメモリ - 飛光よ、飛光よ
ESXi 5.0をUSBメモリからインストールする(Windows上で作業)
boot: mboot.c32[Enter]でいけるとのことだけど、私の環境ではだめだった。

続けて、上記2ブログを参考に syslinuxでのブートを試してみる。 やっぱりダメ。

もういい加減に諦めようかなと思ったけど最後に次のブログを見つけた。
ESXi install from USB flash drive
当初、「最新のsyslinuxは通らんから4.04を使え」とのことで4.04を使っていたが、上記ブログには「not a COM32R には3.72でやれ」と書いてある。

syslinux3.72 でようやくboot画面を通過し、インストールへ進んだ。しかしその先でもCPU、CD-ROM、HDDが各種対象外のようで、最終的に ESXi4.0 + syslinux3.72 + USBドライブへのインストールで一応完了した。

  1. PCにUSBメモリーカードを刺しFAT32でフォーマットする。最近のUSBメモリは大容量で、Windows10だとexFATかNTFSでしかフォーマットできなかったため、上記Rufasを使ってFAT32でフォーマットする。
  2. http://ftp.jaist.ac.jp/pub/Linux/kernel.org/linux/utils/boot/syslinux/ からsyslinux3.72をダウンロードし、適当なフォルダで解凍する。 コマンドプロンプトを管理者権限で実行し\syslinux-3.72\win32\に移動する。
    syslinux -mfa [USBのドライブレター]:と入力。ドライブレターを間違うとそこのデータが全部消えちゃうので厳重に注意。
  3. ESXiの.isoファイルのマウントするなどして中を見る(winodws10なら.isoファイルをそのままダブルクリックしたら中を見られる)。中のファイルを全部USBメモリにコピーする。
  4. USBの中のisolinux.cfg を syslinux.cfg にリネームする。
  5. ESXiをインストールするPCにUSBメモリーカードを挿す。
  6. 起動後、HPと表示される後くらいにF10キーを押してBIOS設定画面に入る。
  7. USB Mass Strage Device Configuretion からUSBメモリーカードをHard Disk として認識させる(CD-ROMとしてはダメ)。
  8. インストール先を聞かれるが、HDDドライブは認識しなかったため、別のUSBメモリーカードにインストールする(ML115マザーボード上にもUSBコネクタがあるのでそこに挿しておく方が外れにくい)。
  9. ようやくインストール完了画面まで進む。再起動時にインストール先のUSBドライブをBIOS画面からもう一度HDDとして認識させておかないと、Panic: No usable banks found.と出る。
  10. とりあえず電源を切ってアップデートなどの残りは後日、と思ったところで薄紫色のエラー画面に変わった(#PF Exception(14))。まるでブルースクリーンの紫版。パープルスクリーンとでも言うか。→実際にそう言うようだ。ESX/ESXi ホストのパープル スクリーンの解析
  11. バージョンが古すぎて対応できてないのかもなと考え、どうせ無理だろうけどと諦めつつ最後にアップデートを試してみた。4.0は立ち上がって一分もしないうちにパープルスクリーンに移行するのでESXiのコンソールからのアップデートは諦め、再度USBメモリーから HP版4.1のアップグレードを試す。始めの一覧通り、やはり「CD-ROMが読み取れませーん」みたいなこと言われる。CD-ROMなんて使わなくていいっつーの。
  12. と文句を言いつつ諦めてHP版5.1を試す。同じく「CPUが対象外っすよ」と言われるが今回は「Continue」という文字が、押してみると……インストール完了してしまった。4.0からうまいこと設定が引き継がれたようだ。時間が経ってもパープルスクリーンに移行する様子はない。メインのWindows機からIPアドレス,vSphere Clientでの接続もできた。しばらく様子を見て、6.0にアップグレードしたい。
  13. 5.1が問題なく動いているので、USBメモリにHP版6.0を入れて起動、アップグレードしてみる。「CPUが対象外」で「Continue...」。インストール完了。Reboot。IPでの接続。vSphere Client6.0での接続を確認。問題ないみたい。

USBメモリからUSBメモリへインストールしてそのUSBからbootさせているんだけど、ML115の場合、毎回BIOSでUSBをHDDとして認識させてあげないといけない…。面倒だけど、サーバーなら一度立ち上げたらめったに落とさないから……まあ遊び用だし。

今回「もうこれがうまくいかなかったら諦めよう」という最後の方法がうまくいってしまい先に進む羽目になることが3回くらいあった…疲れた。費用対効果が悪すぎる。新しいパソコン買いたい。

Windows10 インストールエラー INACCESSIBLE BOOT DEVICE 他

Windows10をインストールしたらはまりまくった。
次のような経緯をたどっています。

  • Windows10 Version 1511 HomeEdition をクリーンインストール。正常に完了。
  • しばらくは普通に使えたが何回かの再起動後
    「問題が発生したため、PCを再起動する必要があります。自動的に再起動します。」
    「詳細については、次のエラーを後からオンラインで検索してみてください: INACCESSIBLE BOOT DEVICE(エラーコードなし)」を繰り返す。(LANケーブルを引っこ抜いて更新不可状態でも陥る)
    →自動修復(スタートアップ修復)、失敗。
    →セーフモードでの起動、失敗。
    コマンドプロンプトからディスクチェック,マスターブートレコードの修復、失敗。
    →このコンピュータを初期状態に戻す、成功。しかし結局しばらく使っていると同様に「INACCESSIBLE BOOT DEVICE」となる。

  • Microsoftサポートに電話で聞いてみる。
    MS「ハード的な不具合があるのかもしれません。Windows7に戻してしばらく使ってみてください」
    →ハードの故障チェックはしてるよ……壊れてはいない。とはいえ、一度 Windows7に戻してみる →ずっと使っていても何ら問題なし。
    MS「Windows 10 Anniversary Update(Ver1607) をインストールしてみてください」
    →インストール時にHDDを読み込まない。"1511"の際にデバイスドライバを確認するとHDDの各種ドライバはRAIDを含めWindows10用が用意されており、無事読み込まれているのに。

  • HDDを認識させる場所でDVDディスクを"1607"から"1511"に入れ替え、ドライバを取り込んでみる。再度"1607"に入れ替えると、一度HDDを認識したかに見えたが再現手順を確認しようとバックしたら再現できなくなった……。

  • Windows10 1511 はHDDを読みこみ初回インストールも完了するので、クリーンインストールではなく"1511"のデスクトップ画面からDVD-ROMを開いて "1607"の上書きインストールを試す。
    →インストールプロセスが進み、成功に見えたが、やはり起動に失敗。さらにRAID 0+1の繋がりが破壊される。(10年ほど前1万円を切る値段で話題になった HP ML115 G5 を使っています。ML115RAID 0+1の復旧方法はこちらまた後日)

  • RAIDの問題を疑い、一度RAIDを切り1台のHDDだけにし "1607"をインストールしてみる。 →成功

  • でもせっかく純正ハードウェアRAID機能がついてるのに使えないなんてヤダヤダ!!
    →USBフラッシュドライブにWindows10 Anniversary Update 回復ドライブを作成,システムイメージバックアップを作成。RAID構成上にインストールした "1511" から "1607" が復旧できないか試す
    https://support.microsoft.com/ja-jp/help/12387/windows-10-update-history からexe形式の最新バージョンで試す。
    →どちらもやっぱり無理。

結局私の場合は「Windwos7でRAIDを選ぶ」か「RAIDなしでWindows10を選ぶ」か、で後者にしました。

ただ、私のPC環境は2008年だか2009年だかに発売されたML115 G5 に同じく同時期に発売の AMD PhenomII X4 940 Black Edition, NVIDIA GeForce 9800 GTX+という古い構成です。
昨今の新しいグラフィックボードに付属するRAIDドライバならちゃんと動くかもしれません。

WindowsもHomeEditionではなくProfessionalならソフトウェアRAIDが使えます。
「INACCESSIBLE BOOT DEVICE」はその名の通り多種多様な原因により起こりますので、別の解決方法がある可能性も高いです。

CentOS6.8 から CentOS7 へのアップグレード

そろそろCentOS7にしてみようかなと思った。
(注:結果としてはアップグレードは失敗し、クリーンインストールすることにしました。
★追記:この記事へのコメントで「openscapをバージョンダウンさせたらエラーがなくなりました」と教えてもらえました。自分でも後で試そうと思います。)
「Pre-Upgradeツール」てのが必要なんでしたっけ、と見に行ったら--

TipsAndTricks - CentOS Wiki

  1. In Place Upgrade of CentOS 6 to CentOS 7

Upgrade CentOS 6 to CentOS 7 Note: This is not the most highly recommended method to move from CentOS 6 to CentOS 7 ... but it can be performed, at your own risk, if the tool says the risk is Slight or None. We would NEVER recommend using this method with any Medium, High or Extreme issues present.

「ここで説明する方法でアップグレードするのはお奨めしない。自己責任でやるならどうぞ。大事なシステムではやめとくように」とな。そして

DO NOT USE this tool. Warning: use of this tool is currently BROKEN as several system-critical packages are of a higher version number in CentOS 6.7 than they are in CentOS 7 so those do not get upgraded correctly. This renders yum and several other system tools non-functional.

「このツールは現在壊れています。幾つかのシステムクリティカルなパッケージにおいて、CentOS7よりCentOS6.7の方がバージョンが高いものがあり、そのためアップグレードはうまくいきません。Yumとかが機能しないよってことです」という感じのことが書かれてるようです。

確かに6.5→7へのアップデートしてる人は見つかるけど、「How to upgrade "CentOS6.8" to CentOS7」「Centos 7 from 6.8」とかで検索しても出てこない。クリーンインストールしろってことかな。

とは言ったってやってみればできるんじゃないの。と無理やりやってみた。

https://wiki.centos.org/TipsAndTricks/CentOSUpgradeTool

Create a Repo file in /etc/yum.repos.d/, named something like upgradetool.repo

Add the following lines to the repo file:

$ vi /etc/yum.repos.d/upgradetool.repo

[upg]
name=CentOS-$releasever - Upgrade Tool
baseurl=http://dev.centos.org/centos/6/upg/x86_64/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

This command will then get the RPMs installed to run an upgrade:

$ yum install redhat-upgrade-tool preupgrade-assistant-contents
完了しました!

ここまでOK。続けて

  1. Preupgrade Assistant Usage

At the moment, only a CLI interface and limited functionality is available.

Usage is simple. Just follow these steps:

Run "preupg -l" command - it lists all available contents for preupgrade-assistant (as the system is based on a plugin, there may be modules from different sources in the future). If nothing is shown, install the preupgrade-assistant-contents package. If you have CentOS6_7 content available, run the command preupg -s CentOS6_7

"preupg -l"コマンドでプリアップグレードアシスタントが利用可能なコンテンツ一覧が表示されます。その後あなたがCentOS6.7を使っているなら"preupg -s CentOS6_7"と実行しましょう。

$ preupg -l
CentOS6_7

当たり前だけど6.8は出てこないね。"preupg -s CentOS6_8"と無理やりやってみましょうか。

$ preupg -s CentOS6_8
Preupg tool doesn't do the actual upgrade.
Please ensure you have backed up your system and/or data in the event of a failed upgrade
 that would require a full re-install of the system from installation media.
Do you want to continue? y/n

y

Specify correct upgrade path parameter like -s RHEL6_7
Upgrade path is provided by command preupg --list
$ preupg --list
CentOS6_7

だめ。じゃ6_7で。

$ preupg -s CentOS6_7
Preupg tool doesn't do the actual upgrade.
Please ensure you have backed up your system and/or data in the event of a failed upgrade
 that would require a full re-install of the system from installation media.
Do you want to continue? y/n
y
Gathering logs used by preupgrade assistant:
All installed packages : 01/11 ...finished (time 00:10s)
All changed files      : 02/11 ...finished (time 10:42s)
Changed config files   : 03/11 ...finished (time 00:00s)
All users              : 04/11 ...finished (time 00:00s)
All groups             : 05/11 ...finished (time 00:00s)
Service statuses       : 06/11 ...finished (time 00:00s)
All installed files    : 07/11 ...finished (time 00:07s)
All local files        : 08/11 ...finished (time 00:24s)
All executable files   : 09/11 ...finished (time 00:08s)
RedHat signed packages : 10/11 ...finished (time 00:00s)
CentOS signed packages : 11/11 ...finished (time 00:00s)
Assessment of the system, running checks / SCE scripts:
001/096 ...done    (Configuration Files to Review)
002/096 ...done    (File Lists for Manual Migration)
003/096 ...done    (Bacula Backup Software)
004/096 ...done    (MySQL configuration)
 ~
094/096 ...done    (NIS server maps check)
095/096 ...done    (NIS server MAXUID and MAXGID limits check)
096/096 ...done    (NIS server config file back-up)
Assessment finished (time 09:47s)
I/O warning : failed to load external entity "/usr/share/openscap/xsl/security-guide.xsl"
compilation error: file /usr/share/preupgrade/xsl/preup.xsl line 40 element import
xsl:import : unable to load /usr/share/openscap/xsl/security-guide.xsl
I/O warning : failed to load external entity "/usr/share/openscap/xsl/oval-report.xsl"
compilation error: file /usr/share/preupgrade/xsl/preup.xsl line 41 element import
xsl:import : unable to load /usr/share/openscap/xsl/oval-report.xsl
I/O warning : failed to load external entity "/usr/share/openscap/xsl/sce-report.xsl"
compilation error: file /usr/share/preupgrade/xsl/preup.xsl line 42 element import
xsl:import : unable to load /usr/share/openscap/xsl/sce-report.xsl
OpenSCAP Error:: Could not parse XSLT file '/usr/share/preupgrade/xsl/preup.xsl' [oscapxml.c:416]
Unable to open file /root/preupgrade/result.html
Usage: preupg [options]

preupg: error: [Errno 2] No such file or directory: '/root/preupgrade/result.html'

だめですね。

諦めて 6.7 からアップデートしましょう。 f:id:demandosigno:20160922212249j:plain

ちゃんと 6.7 が開けてるんでしょうかね。

$ cat /etc/redhat-release
CentOS release 6.8 (Final)

あれー。

$ cat /proc/version
Linux version 2.6.32-573.el6.x86_64 (mockbuild@c6b9.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) ) #1 SMP Thu Jul 23 15:44:03 UTC 2015

まあこっちで見ると正しく 2.6.32-573 になってるからいいか。再度挑戦。

$ preupg -l
CentOS6_7
$ preupg -s CentOS6_7
Preupg tool doesn't do the actual upgrade.
Please ensure you have backed up your system and/or data in the event of a failed upgrade
 that would require a full re-install of the system from installation media.
Do you want to continue? y/n
y
Gathering logs used by preupgrade assistant:
All installed packages : 01/11 ...finished (time 00:02s)
All changed files      : 02/11 ...finished (time 10:26s)
Changed config files   : 03/11 ...finished (time 00:00s)
All users              : 04/11 ...finished (time 00:00s)
All groups             : 05/11 ...finished (time 00:00s)
Service statuses       : 06/11 ...finished (time 00:00s)
All installed files    : 07/11 ...finished (time 00:07s)
All local files        : 08/11 ...finished (time 00:25s)
All executable files   : 09/11 ...finished (time 00:09s)
RedHat signed packages : 10/11 ...finished (time 00:00s)
CentOS signed packages : 11/11 ...finished (time 00:00s)
Assessment of the system, running checks / SCE scripts:
001/096 ...done    (Configuration Files to Review)
002/096 ...done    (File Lists for Manual Migration)
~
085/096 ...done    (Python 2.7.5)
086/096 ...done    (Ruby 2.0.0)
087/096 ...done    (SCL collections)
088/096 ...done    (System kickstart)
089/096 ...done    (YUM)
090/096 ...done    (Check for usage of dangerous range of UID/GIDs)
091/096 ...done    (Incorrect usage of reserved UID/GIDs)
092/096 ...done    (NIS ypbind config files back-up)
093/096 ...done    (NIS Makefile back-up)
094/096 ...done    (NIS server maps check)
095/096 ...done    (NIS server MAXUID and MAXGID limits check)
096/096 ...done    (NIS server config file back-up)
Assessment finished (time 10:08s)
I/O warning : failed to load external entity "/usr/share/openscap/xsl/security-guide.xsl"
compilation error: file /usr/share/preupgrade/xsl/preup.xsl line 40 element import
xsl:import : unable to load /usr/share/openscap/xsl/security-guide.xsl
I/O warning : failed to load external entity "/usr/share/openscap/xsl/oval-report.xsl"
compilation error: file /usr/share/preupgrade/xsl/preup.xsl line 41 element import
xsl:import : unable to load /usr/share/openscap/xsl/oval-report.xsl
I/O warning : failed to load external entity "/usr/share/openscap/xsl/sce-report.xsl"
compilation error: file /usr/share/preupgrade/xsl/preup.xsl line 42 element import
xsl:import : unable to load /usr/share/openscap/xsl/sce-report.xsl
OpenSCAP Error:: Could not parse XSLT file '/usr/share/preupgrade/xsl/preup.xsl' [oscapxml.c:416]
Unable to open file /root/preupgrade/result.html
Usage: preupg [options]

preupg: error: [Errno 2] No such file or directory: '/root/preupgrade/result.html'

ダメ。

result.htmlが生成されたらいろいろ分かるんだろうけど、生成されない。

I/O warning : failed to load external entity "/usr/share/openscap/xsl/security-guide.xsl"

で、ファイル読み込み失敗してる。/usr/share/openscap/xsl/を見たらその名前のファイルはないのでそりゃあ文句言われるよ。

$ rpm -qa | grep openscap
openscap-1.2.8-2.el6.centos.x86_64

OpenSCAPは入ってることは入ってるが……。

oss.sios.com

redhat - preupg: error: No such file or directory: '/usr/share/preupgrade/README' - Stack Overflow

Bug 1304772 – report generation is broken (openscap rebased)

https://rhn.redhat.com/errata/RHBA-2016-1022.html

  • To remain compatible with the most recent Red Hat Enterprise Linux version of OpenSCAP, preupgrade-assistant has been updated to reflect the latest XSLT files in use. (BZ#1304772)

分からない…。素直にクリーンインストールした方がいいか。 確かにこれでアップデートできても、6→7で大きく変わってて整合性取らせるために後でYumやらGRUBやらいろいろ再設定しなくちゃいけないみたいですごく面倒くさそう。

https://wiki.centos.org/Manuals/ReleaseNotes/CentOS6.8/Japanese

7.1. 上位ベンダーにあるパッケージで、CentOS が変更したパッケージ openscap

$ rpm -q --changelog openscap | head -n 20
* 火  5月 10 2016 Johnny Hughes <johnny@centos.org> - 1.2.8-2
- add centos to oval defines

* 木  1月 28 2016 Šimon Lukašík <slukasik@redhat.com> - 1.2.8-2
- patch oscap-vm to support Red Hat Enterprise Linux 6

* 月  1月 18 2016 Šimon Lukašík <slukasik@redhat.com> - 1.2.8-1
- upgrade to the latest upstream release
- Report failures on non-utf8 systems (#1285757)

* 金 12月 04 2015 Šimon Lukašík <slukasik@redhat.com> - 1.2.7-1
- upgrade to the latest upstream release (#1259037)
- Introduced '--verbose' mode (#1287295)
- Detailed OVAL results present in HTML report (#1140240)
- fixed issues in scap-as-rpm tool (#1226398, #1258958)
- introduced support for non-decimal OVAL vetsions (#1248378)
- 'oscap oval eval --report' command (#1258958)
- 'oscap xccdf generate --profile <custom-profile> guide' (#1139822)

* 月  2月 16 2015 Šimon Lukašík <slukasik@redhat.com> - 1.0.10-2

http://ftp.riken.jp/Linux/centos/6.8/os/x86_64/Packages/

openscap-1.2.8-2.el6.centos.x86_64.rpm

http://ftp.riken.jp/Linux/centos/7.2.1511/os/x86_64/Packages/

openscap-1.2.5-3.el7.x86_64.rpm

やっぱり「幾つかのシステムクリティカルなパッケージにおいて、CentOS7よりCentOS6.7の方がバージョンが高いものがあり、そのためアップグレードはうまくいきません。」てことかな。

古いやつ入れたらいけるんだろうか。面倒だ。クリーンインストールしよう。

★追記:コメントで「OpenSCAPのバージョンダウンでエラーはなくなりました」と教えてもらえたので試してみました。

$ rpm -qa | grep openscap
openscap-1.2.8-2.el6.centos.x86_64

# rpm -Uhv --oldpackage http://dev.centos.org/centos/6/upg/x86_64/Packages/openscap-1.0.8-1.0.1.el6.centos.x86_64.rpm
http://dev.centos.org/centos/6/upg/x86_64/Packages/openscap-1.0.8-1.0.1.el6.centos.x86_64.rpm を取得中
準備中...                ########################################### [100%]
   1:openscap               ########################################### [100%]

$ rpm -qa | grep openscap
openscap-1.0.8-1.0.1.el6.centos.x86_64

再挑戦

# preupg -s CentOS6_7
Preupg tool doesn't do the actual upgrade.
Please ensure you have backed up your system and/or data in the event of a failed upgrade
 that would require a full re-install of the system from installation media.
Do you want to continue? y/n

y

Gathering logs used by preupgrade assistant:
All installed packages : 01/11 ...finished (time 00:01s)
All changed files      : 02/11 ...finished (time 04:41s)
Changed config files   : 03/11 ...finished (time 00:00s)
~
095/096 ...done    (NIS server MAXUID and MAXGID limits check)
096/096 ...done    (NIS server config file back-up)
Assessment finished (time 03:21s)
Result table with checks and their results for main contents:
---------------------------------------------------------------
|Bacula Backup Software    |notapplicable |
|MySQL configuration    |notapplicable |
~
|Content for enabling and disabling services based on CentOS 6 system    |needs_action |
|GNOME Desktop Environment underwent several design modifications in CentOS 7 release      |fail |
-----------------------------------------------------------------------------
Tarball with results is stored here /root/preupgrade-results/preupg_results-161107213059.tar.gz .
The latest assessment is stored in directory /root/preupgrade .
Summary information:
We found some critical issues. In-place upgrade is not advised.
Read the file /root/preupgrade/result.html for more details.
Upload results to UI by command:
e.g. preupg -u http://127.0.0.1:8099/submit/ -r /root/preupgrade-results/preupg_results-*.tar.gz .
メールが /var/spool/mail/root にあります

いけてそうですね。あ、PreUpgradeの名の通りここまでが「アップグレードの前準備」なのか。 f:id:demandosigno:20161107231707j:plain 事前検査の結果が保存されていますので、これを見て必要な措置を行います、が…やっぱりいろいろ面倒だし私には良く分からない部分も多い……。GnomeDesktopのパッケージが大きく変わるからうまく動かないよ、とか外部リポジトリとかからインストールされたパッケージはうまくアップグレードできないよ、とか署名がうんぬんとか、まあ放っておいてもなんとかなりそうな物が多いけど。

とりあえず私のCentOS6.8はただのテスト環境なので、事前警告は無視して("FAIL"のGNOME DesktopだけアンインストールしてCUIで)実際にアップグレードに進んでみます。 https://wiki.centos.org/TipsAndTricks/CentOSUpgradeTool

7.How to Upgrade After Reviewing the Results
Once you are ready to upgrade (you have mitigated all issues you care to mitigate, etc.), you first need to import the CentOS-7 RPM key with this command:

rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7 Then run the following command to upgrade:

centos-upgrade-tool-cli --network 7 --instrepo=http://mirror.centos.org/centos/7/os/x86_64/ Then reboot.

8.Known Issues When Upgrading

続きはのちほど。

/* -----codeの行番号----- */