A A A

Please consider registering
guest

Log In

Lost password?
Advanced Search:

— Forum Scope —



— Match —



— Forum Options —




Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
xen SUSE guest with Internet access (Public IP)
December 22, 2016
4:45 pm
Lo0oM
Admin
Forum Posts: 217
Member Since:
September 30, 2012
Offline

Hi

 

Description:

SUSE11SP3 XEN host server installed on VmWare vSphere 6.0. and SUSE11SP3 XEN guest server installed on host.

After installation guest uses default br0 bridge for network access and accessible only from host server.

 

I tried to create a new bridge and interface with route outside the host but assigning it to XEN guest VM give error (in YAST):

error changing vm configuration: failed to build sexpr

 

If i delete VM and create it from the file with right configuration Guest OS still have access to the host only and traffic not routed outside of the host.

 

Solution:

1. I tried many possible solutions like proxy, nat, manual routing, bridges. Nothing works and it seems to me that SUSE 11 SP3 is  completely corrupted (vanilla version). Even openSSH not worked for Filezilla client until i updated it to the latest version.

So working solution is bypassing phisical NIC directly to the guest VM, made it invisible for the host and XEN hypervisor.

 

Configuring the Hypervisor for PCI Pass-Through

# lspci       (find your device)

02:02.0 Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev 01)             #in my case

 

remember it PCI number

 

# vi /etc/sysconfig/pciback

add PCI number to the hide list

 

XEN_PCI_HIDE_LIST="e1000,0000:02:02.0"     

(in my case driver name is e1000 and PCI number full format 0000:02:02.0)

 

 

# vi /usr/sbin/rcpciback

and comment the next lines:

 

bind_dev_to_pciback() {
  for DEVICE in ${XEN_PCI_HIDE_LIST}
  do
    local DRV=`echo ${DEVICE} | /usr/bin/cut -d "," -f 1`
    local PCIID=`echo ${DEVICE} | /usr/bin/cut -d "," -f 2`

   # if ! 1=1 #ls /sys/bus/pci/drivers/pciback/${PCIID} > /dev/null 2>&1     comment this line
    #then                                                                                        comment this line
      echo "Binding ${PCIID} …"
      if ls /sys/bus/pci/drivers/${DRV}/${PCIID} > /dev/null 2>&1
      then
        echo -n ${PCIID} > /sys/bus/pci/drivers/${DRV}/unbind
      fi
      echo -n ${PCIID} > /sys/bus/pci/drivers/pciback/new_slot
      echo -n ${PCIID} > /sys/bus/pci/drivers/pciback/bind
    #fi                                                                                            comment this line
  done
}

unbind_dev_from_pciback() {
  for DEVICE in ${XEN_PCI_HIDE_LIST}
  do
    local DRV=`echo ${DEVICE} | /usr/bin/cut -d "," -f 1`
    local PCIID=`echo ${DEVICE} | /usr/bin/cut -d "," -f 2`

    #if ls /sys/bus/pci/drivers/pciback/${PCIID} > /dev/null                     comment this line
    #then                                                                                      comment this line
      echo "Unbinding ${PCIID} …"
      echo -n ${PCIID} > /sys/bus/pci/drivers/pciback/unbind
    #fi                                                                                         comment this line
  done
}

This script is good but it searching at wrong locations. Anyway we will use it in the future.

 

Run this script:

# /usr/sbin/rcpciback reload

 

Check it for errors and status, it should looks like:

# /usr/sbin/rcpciback status

pciback:  loaded

Currently bound devices …
—————————--
0000:02:02.0

Also

# xl pci-assignable-list
0000:02:02.0

2. Now attach this device to XEN guest VM (be sure it is down):

# xm pci-attach sles11 0000:02:02.0                       (where sles11 is guest VM name)

 

3. To make changes permanent add command

/usr/sbin/rcpciback reload

 

to the /etc/init.d/boot.local file.

 

Start guest VM and enjoy. Now you can assign it public IP from you LAN and it will be visible and accessible from remote.

 

Useful commands:

xm list -l vm_name > filename            copy vm configuration to the file
              
xm del vm_name                  

xm new -F filename to import the virtual machine’s new settings into Xend.

xm start vm_name to start the virtual machine with its new settings.

 

to add, list and remove pass-through devices to XEN

xl pci-assignable-add
xl pci-assignable-list
xl pci-assignable-remove [-r]

 

Links: 1, 2, 3, 4

 

Thank you.

 

Forum Timezone: UTC 0

Most Users Ever Online: 31

Currently Online:
2 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Member Stats:

Guest Posters: 0

Members: 0

Moderators: 0

Admins: 1

Forum Stats:

Groups: 3

Forums: 20

Topics: 214

Posts: 214

Newest Members: Lo0oM

Administrators: Lo0oM (217)