code: def add_vlan_to_interface(self, interface, vlan_id):
          
          subif = '%s.%s' % (interface, vlan_id)
          vlan_id = '%s' % vlan_id
          cmd = ['ip', 'link', 'add', 'link', interface, 'name',
                 subif, 'type', 'vlan', 'id', vlan_id]
          stdcode, stdout = agent_utils.execute(cmd, root=True)
          if stdcode == 0:
              return agent_utils.make_response(code=stdcode)
          # execute failed.
          message = stdout.pop(0)
          return agent_utils.make_response(code=stdcode, message=message)
docs: Add vlan interface.
  
          ip link add link eth0 name eth0.10 type vlan id 10