VM Guest OS自動起動

XenServer6.5使用してGuest OSを3システム稼働させています。昨日外勤時『サーバと接続できませ~ん♪』のヘルプ。手持ちのiPadでVPN接続して解決をしようと奮闘。VMを観察しようにもiPadアプリはキーボードの矢印キー←→↑↓が無く下記のようなメニューを選択するとこが出来ません。なので急いで自宅に戻りPCからのリモートしてメンテが出来た。(このへんAppleは厳しいところ)突然落ちの原因は不明ですが、電源が入ったときVM自動起動の設定がされていなかったため、CLIでこの仕組みを入れ込むことにする。

サポート切れのHP DL380G6で動いています。

GuestOSは全部で3つ このうち一つは自動起動設定済で動いていた。

poollistは関係があるかどうか不明だけどWeb先人の教えに従いました

# xe pool-list
uuid ( RO)                : 5e425a13-8902-8f27-474d-0ac835e7a0e1
          name-label ( RW): VM_Pool_01
    name-description ( RW):
              master ( RO): ce69569a-c270-49f3-abdd-2e479aafb4a0
          default-SR ( RW): <not in database>

xe vm-list

# xe vm-list
uuid ( RO)           : 476cfedd-763d-4f52-9fd0-83887a428e37
     name-label ( RW): Control domain on host: xen00
    power-state ( RO): running


uuid ( RO)           : c67cbb3c-2dfc-2c85-75ca-4ec5bf2dc51a
     name-label ( RW): vmvb-232_server02
    power-state ( RO): running


uuid ( RO)           : 3815625b-8b6c-6149-5274-10914dcc1328
     name-label ( RW): vmdb-233
    power-state ( RO): running


uuid ( RO)           : 1c00bc27-9bff-8eb8-9616-3d29d39f9acc
     name-label ( RW): vmcbz-222
    power-state ( RO): running

vmの状態は

# xe vm-param-list uuid=1c00bc27-9bff-8eb8-9616-3d29d39f9acc
uuid ( RO)                          : 1c00bc27-9bff-8eb8-9616-3d29d39f9acc
                    name-label ( RW): vmcbz-222
              name-description ( RW):
                  user-version ( RW): 1
                 is-a-template ( RW): false
                 is-a-snapshot ( RO): false
                   snapshot-of ( RO): <not in database>
                     snapshots ( RO):
                 snapshot-time ( RO): 19700101T00:00:00Z
                 snapshot-info ( RO):
                        parent ( RO): <not in database>
                      children ( RO):
             is-control-domain ( RO): false
                   power-state ( RO): running
                 memory-actual ( RO): 4294967296
                 memory-target ( RO): 4146581248
               memory-overhead ( RO): 37748736
             memory-static-max ( RW): 4294967296
            memory-dynamic-max ( RW): 4294967296
            memory-dynamic-min ( RW): 4294967296
             memory-static-min ( RW): 1073741824
              suspend-VDI-uuid ( RW): <not in database>
               suspend-SR-uuid ( RW): dad13b5e-f778-b3ce-7adb-816db31ed37a
                  VCPUs-params (MRW):
                     VCPUs-max ( RW): 2
              VCPUs-at-startup ( RW): 2
        actions-after-shutdown ( RW): Destroy
          actions-after-reboot ( RW): Restart
           actions-after-crash ( RW): Restart
                 console-uuids (SRO): 6b8a5dec-fe10-726d-5d76-b890e9e46e3d
                      platform (MRW): timeoffset: -20; viridian: false; nx: true; acpi: 1; vga: std; cores-per-socket: 1; videoram: 8; device_id: 0001; pae: true; apic: true
            allowed-operations (SRO): changing_dynamic_range; migrate_send; pool_migrate; changing_VCPUs_live; suspend; hard_reboot; hard_shutdown; clean_reboot; clean_shutdown; pause; checkpoint; snapshot
            current-operations (SRO):
            blocked-operations (MRW):
           allowed-VBD-devices (SRO): 1; 2; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15
           allowed-VIF-devices (SRO): 0; 2; 3; 4; 5; 6
                possible-hosts ( RO): ce69569a-c270-49f3-abdd-2e479aafb4a0
               HVM-boot-policy ( RW): BIOS order
               HVM-boot-params (MRW): order: cdn
         HVM-shadow-multiplier ( RW): 1.000
                     PV-kernel ( RW):
                    PV-ramdisk ( RW):
                       PV-args ( RW):
                PV-legacy-args ( RW):
                 PV-bootloader ( RW):
            PV-bootloader-args ( RW):
           last-boot-CPU-flags ( RO): vendor: GenuineIntel; features: 009ce3bd-bfebfbff-00000001-28100800
              last-boot-record ( RO): '('struct' ('uuid' '1c00bc27-9bff-8eb8-9616-3d29d39f9acc') ('allowed_operations' ('array')) ('current_operations' ('struct' ('OpaqueRef:40d0ca76-b4e4-95dc-c0db-b86977d6fb59' 'start_on'))) ('power_state' 'Halted') ('name_label' 'vmcbz-222') ('name_description' '') ('user_version' '1') ('is_a_template' ('boolean' '0')) ('suspend_VDI' 'OpaqueRef:NULL') ('resident_on' 'OpaqueRef:NULL') ('affinity' 'OpaqueRef:f9c78140-df1f-0b97-79c9-ca212abc42fb') ('memory_overhead' '37748736') ('memory_target' '0') ('memory_static_max' '4294967296') ('memory_dynamic_max' '4294967296') ('memory_dynamic_min' '4294967296') ('memory_static_min' '1073741824') ('VCPUs_params' ('struct')) ('VCPUs_max' '2') ('VCPUs_at_startup' '2') ('actions_after_shutdown' 'destroy') ('actions_after_reboot' 'restart') ('actions_after_crash' 'restart') ('consoles' ('array')) ('VIFs' ('array' 'OpaqueRef:82fb84bd-0978-60d7-5751-c95e98cd837b')) ('VBDs' ('array' 'OpaqueRef:17d9bb16-c30b-6e46-e2cf-8a411d836d7f' 'OpaqueRef:1f47150c-cb35-05a7-2e62-f047a4490902')) ('crash_dumps' ('array')) ('VTPMs' ('array')) ('PV_bootloader' '') ('PV_kernel' '') ('PV_ramdisk' '') ('PV_args' '') ('PV_bootloader_args' '') ('PV_legacy_args' '') ('HVM_boot_policy' 'BIOS order') ('HVM_boot_params' ('struct' ('order' 'cdn'))) ('HVM_shadow_multiplier' ('double' '1')) ('platform' ('struct' ('timeoffset' '-20') ('viridian' 'false') ('nx' 'true') ('acpi' '1') ('vga' 'std') ('cores-per-socket' '1') ('videoram' '8') ('device_id' '0001') ('pae' 'true') ('apic' 'true'))) ('PCI_bus' '') ('other_config' ('struct' ('vgpu_pci' '') ('mac_seed' '5a514805-063f-9d21-07b3-94a46702058c') ('base_template_name' 'CentOS 7') ('install-methods' 'cdrom,nfs,http,ftp') ('linux_template' 'true'))) ('domid' '-1') ('domarch' '') ('last_boot_CPU_flags' ('struct' ('vendor' 'GenuineIntel') ('features' '009ce3bd-bfebfbff-00000001-28100800'))) ('is_control_domain' ('boolean' '0')) ('metrics' 'OpaqueRef:f272ac1d-dd3b-f356-14d0-4aae8ffb00ca') ('guest_metrics' 'OpaqueRef:8b0a59a7-78a3-9beb-5468-1353331e0fc8') ('last_booted_record' '') ('recommendations' '<restrictions><restriction field=\"memory-static-max\" max=\"549755813888\" /><restriction field=\"vcpus-max\" max=\"16\" /><restriction property=\"number-of-vbds\" max=\"16\" /><restriction property=\"number-of-vifs\" max=\"7\" /><restriction field=\"allow-gpu-passthrough\" value=\"0\" /></restrictions>') ('xenstore_data' ('struct' ('vm-data' ''))) ('ha_always_run' ('boolean' '0')) ('ha_restart_priority' '') ('is_a_snapshot' ('boolean' '0')) ('snapshot_of' 'OpaqueRef:NULL') ('snapshots' ('array')) ('snapshot_time' ('dateTime.iso8601' '19700101T00:00:00Z')) ('transportable_snapshot_id' '') ('blobs' ('struct')) ('tags' ('array')) ('blocked_operations' ('struct')) ('snapshot_info' ('struct')) ('snapshot_metadata' '') ('parent' 'OpaqueRef:NULL') ('children' ('array')) ('bios_strings' ('struct')) ('protection_policy' 'OpaqueRef:NULL') ('is_snapshot_from_vmpp' ('boolean' '0')) ('appliance' 'OpaqueRef:NULL') ('start_delay' '0') ('shutdown_delay' '0') ('order' '0') ('VGPUs' ('array')) ('attached_PCIs' ('array')) ('suspend_SR' 'OpaqueRef:9550badf-f390-4b11-34d1-1c164454d738') ('version' '0') ('generation_id' ''))'
                   resident-on ( RO): ce69569a-c270-49f3-abdd-2e479aafb4a0
                      affinity ( RW): ce69569a-c270-49f3-abdd-2e479aafb4a0
                  other-config (MRW): auto_poweron: false; vgpu_pci: ; mac_seed: 5a514805-063f-9d21-07b3-94a46702058c; base_template_name: CentOS 7; install-methods: cdrom,nfs,http,ftp; linux_template: true
                        dom-id ( RO): 5
               recommendations ( RO): <restrictions><restriction field="memory-static-max" max="549755813888" /><restriction field="vcpus-max" max="16" /><restriction property="number-of-vbds" max="16" /><restriction property="number-of-vifs" max="7" /><restriction field="allow-gpu-passthrough" value="0" /></restrictions>
                 xenstore-data (MRW): vm-data:
    ha-always-run ( RW) [DEPRECATED]: false
           ha-restart-priority ( RW):
                         blobs ( RO):
                    start-time ( RO): 20171108T10:55:43Z
                  install-time ( RO): 20150327T04:11:23Z
                  VCPUs-number ( RO): 2
             VCPUs-utilisation (MRO): 0: 0.037; 1: 0.003
                    os-version (MRO): name: CentOS Linux release 7.4.1708 (Core); uname: 3.10.0-693.2.2.el7.x86_64; distro: centos; major: 7; minor: 4
            PV-drivers-version (MRO): major: 6; minor: 5; micro: 0; build: 90977
         PV-drivers-up-to-date ( RO): true
                        memory (MRO):
                         disks (MRO):
                      networks (MRO): 0/ip: 192.168.1.222; 0/ipv6/0: 2408:a5:7fff:614:2852:2bff:fe1c:b350; 0/ipv6/1: fe80::2852:2bff:fe1c:b350
                         other (MRO): platform-feature-multiprocessor-suspend: 1; feature-suspend: 1; feature-shutdown: 1; feature-vcpu-hotplug: 1; feature-balloon: 1
                          live ( RO): false
    guest-metrics-last-updated ( RO): 20171108T10:58:18Z
      cooperative ( RO) [DEPRECATED]: true
                          tags (SRW):
                     appliance ( RW): <not in database>
                   start-delay ( RW): 0
                shutdown-delay ( RW): 0
                         order ( RW): 0
                       version ( RO): 0
                 generation-id ( RO):

52行目がauto_poweron: false;となっていることでHyperVisorが立ち上がってもVMがOFFのままということが分かる。

poolの電源管理設定

# xe pool-param-set uuid=5e425a13-8902-8f27-474d-0ac835e7a0e1 other-config:poweron=ture

vmの自動起動設定

# xe vm-param-set uuid=1c00bc27-9bff-8eb8-9616-3d29d39f9acc  other-config:auto_poweron=true

再度VMの設定状態を確認

52行目がauto_poweron:  true;となっていることでHyperVisorが立ち上ががりVMがONすることが分かる。

 

# xe vm-param-list uuid=1c00bc27-9bff-8eb8-9616-3d29d39f9acc
uuid ( RO)                          : 1c00bc27-9bff-8eb8-9616-3d29d39f9acc
                    name-label ( RW): vmcbz-222
              name-description ( RW):
                  user-version ( RW): 1
                 is-a-template ( RW): false
                 is-a-snapshot ( RO): false
                   snapshot-of ( RO): <not in database>
                     snapshots ( RO):
                 snapshot-time ( RO): 19700101T00:00:00Z
                 snapshot-info ( RO):
                        parent ( RO): <not in database>
                      children ( RO):
             is-control-domain ( RO): false
                   power-state ( RO): running
                 memory-actual ( RO): 4294967296
                 memory-target ( RO): 4146581248
               memory-overhead ( RO): 37748736
             memory-static-max ( RW): 4294967296
            memory-dynamic-max ( RW): 4294967296
            memory-dynamic-min ( RW): 4294967296
             memory-static-min ( RW): 1073741824
              suspend-VDI-uuid ( RW): <not in database>
               suspend-SR-uuid ( RW): dad13b5e-f778-b3ce-7adb-816db31ed37a
                  VCPUs-params (MRW):
                     VCPUs-max ( RW): 2
              VCPUs-at-startup ( RW): 2
        actions-after-shutdown ( RW): Destroy
          actions-after-reboot ( RW): Restart
           actions-after-crash ( RW): Restart
                 console-uuids (SRO): 6b8a5dec-fe10-726d-5d76-b890e9e46e3d
                      platform (MRW): timeoffset: -20; viridian: false; nx: true; acpi: 1; vga: std; cores-per-socket: 1; videoram: 8; device_id: 0001; pae: true; apic: true
            allowed-operations (SRO): changing_dynamic_range; migrate_send; pool_migrate; changing_VCPUs_live; suspend; hard_reboot; hard_shutdown; clean_reboot; clean_shutdown; pause; checkpoint; snapshot
            current-operations (SRO):
            blocked-operations (MRW):
           allowed-VBD-devices (SRO): 1; 2; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15
           allowed-VIF-devices (SRO): 0; 2; 3; 4; 5; 6
                possible-hosts ( RO): ce69569a-c270-49f3-abdd-2e479aafb4a0
               HVM-boot-policy ( RW): BIOS order
               HVM-boot-params (MRW): order: cdn
         HVM-shadow-multiplier ( RW): 1.000
                     PV-kernel ( RW):
                    PV-ramdisk ( RW):
                       PV-args ( RW):
                PV-legacy-args ( RW):
                 PV-bootloader ( RW):
            PV-bootloader-args ( RW):
           last-boot-CPU-flags ( RO): vendor: GenuineIntel; features: 009ce3bd-bfebfbff-00000001-28100800
              last-boot-record ( RO): '('struct' ('uuid' '1c00bc27-9bff-8eb8-9616-3d29d39f9acc') ('allowed_operations' ('array')) ('current_operations' ('struct' ('OpaqueRef:40d0ca76-b4e4-95dc-c0db-b86977d6fb59' 'start_on'))) ('power_state' 'Halted') ('name_label' 'vmcbz-222') ('name_description' '') ('user_version' '1') ('is_a_template' ('boolean' '0')) ('suspend_VDI' 'OpaqueRef:NULL') ('resident_on' 'OpaqueRef:NULL') ('affinity' 'OpaqueRef:f9c78140-df1f-0b97-79c9-ca212abc42fb') ('memory_overhead' '37748736') ('memory_target' '0') ('memory_static_max' '4294967296') ('memory_dynamic_max' '4294967296') ('memory_dynamic_min' '4294967296') ('memory_static_min' '1073741824') ('VCPUs_params' ('struct')) ('VCPUs_max' '2') ('VCPUs_at_startup' '2') ('actions_after_shutdown' 'destroy') ('actions_after_reboot' 'restart') ('actions_after_crash' 'restart') ('consoles' ('array')) ('VIFs' ('array' 'OpaqueRef:82fb84bd-0978-60d7-5751-c95e98cd837b')) ('VBDs' ('array' 'OpaqueRef:17d9bb16-c30b-6e46-e2cf-8a411d836d7f' 'OpaqueRef:1f47150c-cb35-05a7-2e62-f047a4490902')) ('crash_dumps' ('array')) ('VTPMs' ('array')) ('PV_bootloader' '') ('PV_kernel' '') ('PV_ramdisk' '') ('PV_args' '') ('PV_bootloader_args' '') ('PV_legacy_args' '') ('HVM_boot_policy' 'BIOS order') ('HVM_boot_params' ('struct' ('order' 'cdn'))) ('HVM_shadow_multiplier' ('double' '1')) ('platform' ('struct' ('timeoffset' '-20') ('viridian' 'false') ('nx' 'true') ('acpi' '1') ('vga' 'std') ('cores-per-socket' '1') ('videoram' '8') ('device_id' '0001') ('pae' 'true') ('apic' 'true'))) ('PCI_bus' '') ('other_config' ('struct' ('vgpu_pci' '') ('mac_seed' '5a514805-063f-9d21-07b3-94a46702058c') ('base_template_name' 'CentOS 7') ('install-methods' 'cdrom,nfs,http,ftp') ('linux_template' 'true'))) ('domid' '-1') ('domarch' '') ('last_boot_CPU_flags' ('struct' ('vendor' 'GenuineIntel') ('features' '009ce3bd-bfebfbff-00000001-28100800'))) ('is_control_domain' ('boolean' '0')) ('metrics' 'OpaqueRef:f272ac1d-dd3b-f356-14d0-4aae8ffb00ca') ('guest_metrics' 'OpaqueRef:8b0a59a7-78a3-9beb-5468-1353331e0fc8') ('last_booted_record' '') ('recommendations' '<restrictions><restriction field=\"memory-static-max\" max=\"549755813888\" /><restriction field=\"vcpus-max\" max=\"16\" /><restriction property=\"number-of-vbds\" max=\"16\" /><restriction property=\"number-of-vifs\" max=\"7\" /><restriction field=\"allow-gpu-passthrough\" value=\"0\" /></restrictions>') ('xenstore_data' ('struct' ('vm-data' ''))) ('ha_always_run' ('boolean' '0')) ('ha_restart_priority' '') ('is_a_snapshot' ('boolean' '0')) ('snapshot_of' 'OpaqueRef:NULL') ('snapshots' ('array')) ('snapshot_time' ('dateTime.iso8601' '19700101T00:00:00Z')) ('transportable_snapshot_id' '') ('blobs' ('struct')) ('tags' ('array')) ('blocked_operations' ('struct')) ('snapshot_info' ('struct')) ('snapshot_metadata' '') ('parent' 'OpaqueRef:NULL') ('children' ('array')) ('bios_strings' ('struct')) ('protection_policy' 'OpaqueRef:NULL') ('is_snapshot_from_vmpp' ('boolean' '0')) ('appliance' 'OpaqueRef:NULL') ('start_delay' '0') ('shutdown_delay' '0') ('order' '0') ('VGPUs' ('array')) ('attached_PCIs' ('array')) ('suspend_SR' 'OpaqueRef:9550badf-f390-4b11-34d1-1c164454d738') ('version' '0') ('generation_id' ''))'
                   resident-on ( RO): ce69569a-c270-49f3-abdd-2e479aafb4a0
                      affinity ( RW): ce69569a-c270-49f3-abdd-2e479aafb4a0
                  other-config (MRW): auto_poweron: true; vgpu_pci: ; mac_seed: 5a514805-063f-9d21-07b3-94a46702058c; base_template_name: CentOS 7; install-methods: cdrom,nfs,http,ftp; linux_template: true
                        dom-id ( RO): 5
               recommendations ( RO): <restrictions><restriction field="memory-static-max" max="549755813888" /><restriction field="vcpus-max" max="16" /><restriction property="number-of-vbds" max="16" /><restriction property="number-of-vifs" max="7" /><restriction field="allow-gpu-passthrough" value="0" /></restrictions>
                 xenstore-data (MRW): vm-data:
    ha-always-run ( RW) [DEPRECATED]: false
           ha-restart-priority ( RW):
                         blobs ( RO):
                    start-time ( RO): 20171108T10:55:43Z
                  install-time ( RO): 20150327T04:11:23Z
                  VCPUs-number ( RO): 2
             VCPUs-utilisation (MRO): 0: 0.037; 1: 0.003
                    os-version (MRO): name: CentOS Linux release 7.4.1708 (Core); uname: 3.10.0-693.2.2.el7.x86_64; distro: centos; major: 7; minor: 4
            PV-drivers-version (MRO): major: 6; minor: 5; micro: 0; build: 90977
         PV-drivers-up-to-date ( RO): true
                        memory (MRO):
                         disks (MRO):
                      networks (MRO): 0/ip: 192.168.1.222; 0/ipv6/0: 2408:a5:7fff:614:2852:2bff:fe1c:b350; 0/ipv6/1: fe80::2852:2bff:fe1c:b350
                         other (MRO): platform-feature-multiprocessor-suspend: 1; feature-suspend: 1; feature-shutdown: 1; feature-vcpu-hotplug: 1; feature-balloon: 1
                          live ( RO): false
    guest-metrics-last-updated ( RO): 20171108T10:58:18Z
      cooperative ( RO) [DEPRECATED]: true
                          tags (SRW):
                     appliance ( RW): <not in database>
                   start-delay ( RW): 0
                shutdown-delay ( RW): 0
                         order ( RW): 0
                       version ( RO): 0
                 generation-id ( RO):

Hyper-Visor側を再起動し各VMが稼働している事を確認する。

※CLIにこだわりすぎていたこと反省GUIで単純にONしてやればすぐに復旧出来た。orz

冒頭に記しましたがなぜ電源が落ちたのかを明確にしなければなりません。サーバのお守りは大変。。

コメント