segunda-feira, 23 de maio de 2016

Configurando rede xenserver via console/terminal


XenServer 4.1

With the release of 4.1 and later, the management of network configurations are now controlled by the XAPI and not done through manipulating the network configuration files.
  1. From the command line interface (CLI), identify the Physical Interface (PIF) you want to set the IP address on:
    [root@xenserver-xxxxxx ~]# xe pif-list params=all
    uuid ( RO)                     : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
                       device ( RO): eth0
                          MAC ( RO): 00:1d:09:08:85:0c
                     physical ( RO): true
           currently-attached ( RO): true
                          MTU ( RO): 1500
                         VLAN ( RO): -1
               bond-master-of ( RO):
                bond-slave-of ( RO): 
                   management ( RO): true
                 network-uuid ( RO): xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
           network-name-label ( RO): Pool-wide network associated with eth0
                    host-uuid ( RO): 074bc1df-2560-4de8-9b8a-e483df1109c3
              host-name-label ( RO): xenserver-xxxxxx
        IP-configuration-mode ( RO): Static
                           IP ( RO): 10.217.130.3
                      netmask ( RO): 255.255.255.240
                      gateway ( RO): 10.217.130.1
                          DNS ( RO): 10.217.130.2
                  io_read_kbs ( RO): 
                 io_write_kbs ( RO): 
                      carrier ( RO): true
                    vendor-id ( RO): 14e4
                  vendor-name ( RO): Broadcom Corporation
                    device-id ( RO): 167a
                  device-name ( RO): NetXtreme BCM5754 Gigabit Ethernet PCI Express
                        speed ( RO): 100 Mbit/s
                       duplex ( RO): full
              disallow-unplug ( RW): false
                 pci-bus-path ( RO): 0000:04:00.0
                 other-config (MRW):
  2. Use the pif reconfigure command to set the values: [root@xenserver-xxxxxx ~]# xe –pif-reconfigure-ip DNS=x.x.x.x gateway=x.x.x.x IP=x.x.x.x netmask=x.x.x.x uuid= xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (enter the uuid of the PIF you want to reconfigure)

Reativando RAID

The RAID device appears to be inactive somehow:
# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] 
                [raid4] [raid10] 
md_d0 : inactive sda4[0](S)
      241095104 blocks

# mdadm --detail /dev/md0
mdadm: md device /dev/md0 does not appear to be active.




Code:
matt@OptimusPrime:~$ sudo mdadm --detail /dev/md0
mdadm: md device /dev/md0 does not appear to be active.
matt@OptimusPrime:~$ sudo mdadm --run /dev/md0
mdadm: failed to run array /dev/md0: Input/output error
matt@OptimusPrime:~$ sudo mdadm --detail /dev/md0
/dev/md0:
        Version : 00.90
  Creation Time : Thu Nov 24 18:01:12 2011
     Raid Level : raid5
  Used Dev Size : 1953511936 (1863.01 GiB 2000.40 GB)
   Raid Devices : 4
  Total Devices : 2
Preferred Minor : 0
    Persistence : Superblock is persistent

    Update Time : Mon Jan 21 16:40:08 2013
          State : active, degraded, Not Started
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

         Layout : left-symmetric
     Chunk Size : 64K

           UUID : dc256ec9:45cdecc4:fbf2ea5a:12bfd232 (local to host OptimusPrime)
         Events : 0.90803

    Number   Major   Minor   RaidDevice State
       0       0        0        0      removed
       1       8       33        1      active sync   /dev/sdc1
       2       8       17        2      active sync   /dev/sdb1
       3       0        0        3      removed
matt@OptimusPrime:~$ 
matt@OptimusPrime:~$ sudo mdadm --examine /dev/sd[bcde]1
/dev/sdb1:
          Magic : a92b4efc
        Version : 00.90.00
           UUID : dc256ec9:45cdecc4:fbf2ea5a:12bfd232 (local to host OptimusPrime)
  Creation Time : Thu Nov 24 18:01:12 2011
     Raid Level : raid5
  Used Dev Size : 1953511936 (1863.01 GiB 2000.40 GB)
     Array Size : 5860535808 (5589.04 GiB 6001.19 GB)
   Raid Devices : 4
  Total Devices : 2
Preferred Minor : 0

    Update Time : Mon Jan 21 16:40:08 2013
          State : active
 Active Devices : 2
Working Devices : 2
 Failed Devices : 1
  Spare Devices : 0
       Checksum : ee0ec535 - correct
         Events : 90803

         Layout : left-symmetric
     Chunk Size : 64K

      Number   Major   Minor   RaidDevice State
this     2       8       17        2      active sync   /dev/sdb1

   0     0       0        0        0      removed
   1     1       8       33        1      active sync   /dev/sdc1
   2     2       8       17        2      active sync   /dev/sdb1
   3     3       0        0        3      faulty removed
/dev/sdc1:
          Magic : a92b4efc
        Version : 00.90.00
           UUID : dc256ec9:45cdecc4:fbf2ea5a:12bfd232 (local to host OptimusPrime)
  Creation Time : Thu Nov 24 18:01:12 2011
     Raid Level : raid5
  Used Dev Size : 1953511936 (1863.01 GiB 2000.40 GB)
     Array Size : 5860535808 (5589.04 GiB 6001.19 GB)
   Raid Devices : 4
  Total Devices : 2
Preferred Minor : 0

    Update Time : Mon Jan 21 16:40:08 2013
          State : active
 Active Devices : 2
Working Devices : 2
 Failed Devices : 1
  Spare Devices : 0
       Checksum : ee0ec543 - correct
         Events : 90803

         Layout : left-symmetric
     Chunk Size : 64K

      Number   Major   Minor   RaidDevice State
this     1       8       33        1      active sync   /dev/sdc1

   0     0       0        0        0      removed
   1     1       8       33        1      active sync   /dev/sdc1
   2     2       8       17        2      active sync   /dev/sdb1
   3     3       0        0        3      faulty removed
mdadm: No md superblock detected on /dev/sdd1.
/dev/sde1:
          Magic : a92b4efc
        Version : 00.90.00
           UUID : dc256ec9:45cdecc4:fbf2ea5a:12bfd232 (local to host OptimusPrime)
  Creation Time : Thu Nov 24 18:01:12 2011
     Raid Level : raid5
  Used Dev Size : 1953511936 (1863.01 GiB 2000.40 GB)
     Array Size : 5860535808 (5589.04 GiB 6001.19 GB)
   Raid Devices : 4
  Total Devices : 3
Preferred Minor : 0

    Update Time : Mon Jan 21 16:10:12 2013
          State : clean
 Active Devices : 2
Working Devices : 3
 Failed Devices : 1
  Spare Devices : 1
       Checksum : ee102159 - correct
         Events : 90796

         Layout : left-symmetric
     Chunk Size : 64K

      Number   Major   Minor   RaidDevice State
this     4       8       65        4      spare   /dev/sde1

   0     0       0        0        0      removed
   1     1       8       33        1      active sync   /dev/sdc1
   2     2       8       17        2      active sync   /dev/sdb1
   3     3       0        0        3      faulty removed
   4     4       8       65        4      spare   /dev/sde1
matt@OptimusPrime:~$


Code:
sudo -i
mdadm --stop /dev/md0
mdadm --assemble --force /dev/md0 /dev/sd[bce]1