IBM Cloud Docs
为什么我的 RHEL 虚拟服务器从经典基础架构自定义映像创建时处于失败状态?

为什么我的 RHEL 虚拟服务器从经典基础架构自定义映像创建时处于失败状态?

从 IBM Cloud® 经典基础架构导入 Red Hat Enterprise Linux 自定义图像到 IBM Cloud VPC 后,您就可以使用它来在 VPC 中创建新的虚拟服务器实例。 然而,新的虚拟服务器实例仍处于失败状态。

您使用了来自 IBM Cloud Classic Infrastructure的 Red Hat Enterprise Linux 自定义图像,该图像已导入 IBM Cloud VPC,用于在VPC中配置新的虚拟服务器实例。 然而,新的虚拟服务器实例无法成功启动,处于失败状态。

当使用经典基础架构自定义映像创建的新 VPC 虚拟服务器尝试启动时,Red Hat Enterprise Linux 许可证激活失败。

要解决VPC环境中 Red Hat Enterprise Linux 图片的授权问题,您必须登录到失败的虚拟服务器,重新安排网络路由,并重新注册操作系统。 当许可问题解决后,虚拟服务器实例应该可以成功启动。

要完成这些步骤,您需要使用默认用户账户。 Linux 的默认用户账户取决于操作系统。 要查看操作系统列表及其对应的默认用户账户,请参阅 连接到 Linux 实例:确定默认用户账户

  1. 使用SSH登录失败的虚拟服务器实例。 在 IBM Cloud 控制台的虚拟服务器实例页面中找到虚拟服务器实例的IP地址。 在终端中使用SSH登录失败的虚拟服务器实例。 以下示例演示了如何使用SSH从终端登录虚拟服务器实例。

    ~ % ssh -i .ssh/id_rsa_vsikey1 <default-user-account>@52.116.206.42
    Warning: Permanently added '52.116.206.42' (ECDSA) to the list of known hosts.
    [root@skv-vsirh2x7 ~]#
    
  2. 重新安排处于故障状态的 Red Hat Enterprise Linux 操作系统的网络路由。

    1. 从ip/路由表中确定正确的网关。 使用ip show/ route命令获取当前路由的完整列表。 使用ping命令确定正确的网关。 请参阅以下示例:

      [root@skv-vsic1x7im ~]# route -n
      Kernel IP routing table
      Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
      0.0.0.0         10.240.66.1     0.0.0.0         UG    0      0        0 eth0
      0.0.0.0         10.240.66.1     0.0.0.0         UG    100    0        0 eth0
      10.0.0.0        10.187.149.65   255.0.0.0       UG    100    0        0 eth0
      10.187.149.65   0.0.0.0         255.255.255.255 UH    100    0        0 eth0
      10.240.66.0     0.0.0.0         255.255.255.0   U     100    0        0 eth0
      161.26.0.0      10.187.149.65   255.255.0.0     UG    100    0        0 eth0
      166.8.0.0       10.187.149.65   255.252.0.0     UG    100    0        0 eth0
      
      [root@skv-vsic1x7im ~]# ping 10.240.66.1
      PING 10.240.66.1 (10.240.66.1) 56(84) bytes of data.
      64 bytes from 10.240.66.1: icmp_seq=1 ttl=64 time=0.183 ms
      64 bytes from 10.240.66.1: icmp_seq=2 ttl=64 time=0.176 ms
      ^C
      --- 10.240.66.1 ping statistics ---
      2 packets transmitted, 2 received, 0% packet loss, time 1000ms
      rtt min/avg/max/mdev = 0.176/0.179/0.183/0.013 ms
      
    2. 使用IP或路由命令删除不必要的静态路由。 使用路线表中的信息,删除不必要的路线。 请参阅以下示例:

      [root@skv-vsic1x7im ~]# route del -net 166.8.0.0 gw 10.187.149.65 netmask 255.252.0.0 dev eth0
      [root@skv-vsic1x7im ~]# route del -net 161.26.0.0 gw 10.187.149.65 netmask 255.255.0.0 dev eth0
      [root@skv-vsic1x7im ~]# route del -net 10.187.149.65 gw 0.0.0.0 netmask 255.255.255.255 dev eth0
      [root@skv-vsic1x7im ~]# route del -net 10.0.0.0 gw 10.187.149.65 netmask 255.0.0.0 dev eth0
      [root@skv-vsic1x7im ~]# route -n
      Kernel IP routing table
      Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
      0.0.0.0         10.240.66.1     0.0.0.0         UG    0      0        0 eth0
      0.0.0.0         10.240.66.1     0.0.0.0         UG    100    0        0 eth0
      10.240.66.0     0.0.0.0         255.255.255.0   U     100    0        0 eth0
      
    3. 从系统文件中永久删除所有不必要的网关。 旧门户路线的详细信息可在文件 /etc/sysconfig/network-scripts/route-eth0 中找到。 请参阅以下示例。

      # Created by cloud-init on instance boot automatically, do not edit.
      #
      ADDRESS0=10.0.0.0
      GATEWAY0=10.187.149.65
      NETMASK0=255.0.0.0
      ADDRESS1=161.26.0.0
      GATEWAY1=10.187.149.65
      NETMASK1=255.255.0.0
      ADDRESS2=166.8.0.0
      GATEWAY2=10.187.149.65
      NETMASK2=255.252.0.0
      

      删除不必要的网关信息,使文件看起来与以下示例类似。

      # Created by cloud-init on instance boot automatically, do not edit.
      #
      
  3. 在您的虚拟服务器实例上重新注册 Red Hat Enterprise Linux 操作系统。 目前,Red Hat Enterprise Linux 操作系统仍处于未订阅状态。

    1. 您可以通过运行以下命令来验证退订状态。 请参阅以下示例:

      [root@skv-vsic1x7im ~]# subscription-manager list
      You are attempting to use a locale that is not installed.
      +-------------------------------------------+
            Installed Product Status
      +-------------------------------------------+
      Product Name:   Red Hat Enterprise Linux Server
      Product ID:     69
      Version:        7.9
      Arch:           x86_64
      Status:         Unknown
      Status Details:
      Starts:
      Ends:
      
      [root@skv-vsic1x7im ~]#
      
    2. 运行订阅脚本 /var/lib/cloud/instances/(VSI/Instance ID)/scripts/vendor/part-00*,其中包含注册订阅()函数。 脚本完成后,操作系统即被订阅。 请参阅以下示例:

      [root@skv-vsic1x7im ~]#./var/lib/cloud/instances/0727_60b2078d-8e30-4c66-a894-b1fbd0ed7acf/scripts/vendor/part-004
      

      脚本完成后,请检查细节。 请参阅以下示例:

      [root@skv-vsic1x7im ~]# subscription-manager list
      You are attempting to use a locale that is not installed.
      +-------------------------------------------+
          Installed Product Status
      +-------------------------------------------+
      Product Name:   Red Hat Enterprise Linux Server
      Product ID:     69
      Version:        7.9
      Arch:           x86_64
      Status:         Subscribed
      Status Details:
      Starts:         12/31/20
      Ends:           01/16/22
      
      [root@skv-vsic1x7im ~]#
      
  4. 从 IBM Cloud 控制台重新启动虚拟服务器实例。 失败状态变为运行状态