spice can't support usb redirection

Bug #1641517 reported by wang jiedong
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Expired
Undecided
Unassigned

Bug Description

I have a environment of Newton in ubuntu16.04, every component that i install is ok ,
then i build a vm with spice proxy,the configurations in nova.conf like :

[spice]
enabled = True
agent_enabled = True
server_listen = 0.0.0.0
server_proxyclient_address = $my_ip
html5proxy_base_url = http://$my_ip:6082/spice_auto.html

of course the console is also ok ,but when i want transfer some doc to vm from client usb, vm can't find the usb device
there is nothing about usb in vm.xml :

<domain type='kvm' id='19'>
  <name>instance-00000010</name>
  <uuid>e465443f-32b6-4cb7-9e17-2aec45bac79f</uuid>
  <metadata>
    <nova:instance xmlns:nova="http://openstack.org/xmlns/libvirt/nova/1.0">
      <nova:package version="14.0.1"/>
      <nova:name>ccc</nova:name>
      <nova:creationTime>2016-11-11 09:23:24</nova:creationTime>
      <nova:flavor name="micro">
        <nova:memory>256</nova:memory>
        <nova:disk>1</nova:disk>
        <nova:swap>0</nova:swap>
        <nova:ephemeral>0</nova:ephemeral>
        <nova:vcpus>1</nova:vcpus>
      </nova:flavor>
      <nova:owner>
        <nova:user uuid="bca1c2494f9c4680931e7000500ce785">admin</nova:user>
        <nova:project uuid="8375cad45b8945838d86f4ebe5622bac">admin</nova:project>
      </nova:owner>
      <nova:root type="image" uuid="f45bcd7f-c774-425a-8aff-b14a4a065497"/>
    </nova:instance>
  </metadata>
  <memory unit='KiB'>262144</memory>
  <currentMemory unit='KiB'>262144</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <cputune>
    <shares>1024</shares>
  </cputune>
  <resource>
    <partition>/machine</partition>
  </resource>
  <sysinfo type='smbios'>
    <system>
      <entry name='manufacturer'>OpenStack Foundation</entry>
      <entry name='product'>OpenStack Nova</entry>
      <entry name='version'>14.0.1</entry>
      <entry name='serial'>6a0225ac-4f57-329c-e89c-60965806fac3</entry>
      <entry name='uuid'>e465443f-32b6-4cb7-9e17-2aec45bac79f</entry>
      <entry name='family'>Virtual Machine</entry>
    </system>
  </sysinfo>
  <os>
    <type arch='x86_64' machine='pc-i440fx-xenial'>hvm</type>
    <boot dev='hd'/>
    <smbios mode='sysinfo'/>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  <cpu mode='host-model'>
    <model fallback='allow'/>
    <topology sockets='1' cores='1' threads='1'/>
  </cpu>
  <clock offset='utc'>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/bin/kvm-spice</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/var/lib/nova/instances/e465443f-32b6-4cb7-9e17-2aec45bac79f/disk'/>
      <backingStore type='file' index='1'>
        <format type='raw'/>
        <source file='/var/lib/nova/instances/_base/69a052e8d9d9ac900d307dd36f4d5e5dc79e1365'/>
        <backingStore/>
      </backingStore>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
    <controller type='usb' index='0'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'>
      <alias name='pci.0'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <alias name='virtio-serial0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='fa:16:3e:e2:56:4c'/>
      <source bridge='brqc47a5070-9e'/>
      <target dev='tap73ffa97f-f3'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='file'>
      <source path='/var/lib/nova/instances/e465443f-32b6-4cb7-9e17-2aec45bac79f/console.log'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <serial type='pty'>
      <source path='/dev/pts/1'/>
      <target port='1'/>
      <alias name='serial1'/>
    </serial>
    <console type='file'>
      <source path='/var/lib/nova/instances/e465443f-32b6-4cb7-9e17-2aec45bac79f/console.log'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <channel type='pty'>
      <source path='/dev/pts/2'/>
      <target type='virtio' name='com.redhat.spice.0' state='disconnected'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='spice' port='5900' autoport='yes' listen='0.0.0.0' keymap='en-us'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <stats period='10'/>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </memballoon>
  </devices>
  <seclabel type='dynamic' model='apparmor' relabel='yes'>
    <label>libvirt-e465443f-32b6-4cb7-9e17-2aec45bac79f</label>
    <imagelabel>libvirt-e465443f-32b6-4cb7-9e17-2aec45bac79f</imagelabel>
  </seclabel>
</domain>

wang jiedong (jeery)
Changed in nova:
assignee: nobody → wang jiedong (jeery)
wang jiedong (jeery)
Changed in nova:
status: New → In Progress
wang jiedong (jeery)
Changed in nova:
status: In Progress → New
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/newton)

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/397635

Revision history for this message
Matt Riedemann (mriedem) wrote :

Do you see warnings in the nova-compute logs when creating the guest?

What do you have set for the use_usb_tablet and pointer_model config options?

What is the libvirt.virt_type value in your nova.conf?

See the config docs for more information on those options:

http://docs.openstack.org/developer/nova/sample_config.html

Changed in nova:
status: New → Incomplete
Revision history for this message
wang jiedong (jeery) wrote :

sorry ,i think i didn't describe it clearly, the virt_type is kvm, and a parameter usbredir_channels is added in nova.conf after spice section, my total nova.conf like this:

[DEFAULT]
dhcpbridge_flagfile=/etc/nova/nova.conf
dhcpbridge=/usr/bin/nova-dhcpbridge
log-dir=/var/log/nova
state_path=/var/lib/nova
force_dhcp_release=True
verbose=True
ec2_private_dns_show_ip=True
enabled_apis=osapi_compute,metadata

transport_url = rabbit://openstack:RABBIT_PASS@newtu
auth_strategy = keystone
my_ip=192.168.178.24
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver

[vnc]
enabled = False
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = $my_ip
novncproxy_base_url = http://$my_ip:6080/vnc_auto.html

[spice]
enabled = True
agent_enabled = True
server_listen = 0.0.0.0
server_proxyclient_address = $my_ip
html5proxy_base_url = http://$my_ip:6082/spice_auto.html
usbredir_channels = 4

[database]
connection = mysql+pymysql://nova:NOVA_DBPASS@newtu/nova

[api_database]
connection = mysql+pymysql://nova:NOVA_DBPASS@newtu/nova_api

[oslo_concurrency]
lock_path=/var/lock/nova/tmp

[libvirt]
use_virtio_for_bridges=True

[wsgi]
api_paste_config=/etc/nova/api-paste.ini

[keystone_authtoken]
auth_uri = http://newtu:5000
auth_url = http://newtu:35357
memcached_servers = newtu:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = nova

[glance]
api_servers = http://newtu:9292

[neutron]
url = http://newtu:9696
auth_url = http://newtu:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = neutron
service_metadata_proxy = True
metadata_proxy_shared_secret = METADATA_SECRET

[cinder]
os_region_name = RegionOne

then, in the VM's XML i can find usb channels :

    <redirdev bus='usb' type='spicevmc'>
      <alias name='redir0'/>
    </redirdev>
    <redirdev bus='usb' type='spicevmc'>
      <alias name='redir1'/>
    </redirdev>
    <redirdev bus='usb' type='spicevmc'>
      <alias name='redir2'/>
    </redirdev>
    <redirdev bus='usb' type='spicevmc'>
      <alias name='redir3'/>
    </redirdev>

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (stable/newton)

Change abandoned by Lee Yarwood (<email address hidden>) on branch: stable/newton
Review: https://review.openstack.org/397635
Reason: Abandoning this review given it is not suitable for stable/newton and has not been touched for a few weeks.

Sean Dague (sdague)
Changed in nova:
assignee: wang jiedong (jeery) → nobody
Revision history for this message
Sean Dague (sdague) wrote :

Automatically discovered version newton in description. If this is incorrect, please update the description to include 'nova version: ...'

tags: added: openstack-version.newton
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for OpenStack Compute (nova) because there has been no activity for 60 days.]

Changed in nova:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.