<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<style>
    font{
        line-height: 1.6;
    }
    ul,ol{
        padding-left: 20px;
        list-style-position: inside;
    }
</style>
<div style="font-family:微软雅黑,Verdana,"Microsoft Yahei",SimSun,sans-serif;font-size:14px; line-height:1.6;">
    <div></div><div>
    <div>
        <span>
            <br>
        </span>
    </div>
    <div><span>Well,I see. Thanks to Sean for your detailed answer!
        </span></div>
    </div><div class="J-reply" style="background-color:#f2f2f2;color:black;padding-top:6px;padding-bottom:6px;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;margin-top:45px;margin-bottom:20px;font-family:'微软雅黑';"><div style="font-size:12px;line-height:1.5;word-break:break-all;margin-left:10px;margin-right:10px">On <span class="mail-date">12/14/2021 00:33</span>,<a class="mail-to" style="text-decoration:none;color:#2a83f2;" href="mailto:smooney@redhat.com">Sean Mooney<smooney@redhat.com></a> wrote: </div>
</div>
<blockquote id="ntes-pcmail-quote" style="margin: 0; padding: 0; font-size: 14px; font-family: '微软雅黑';">
On Mon, 2021-12-13 at 09:54 +0800, Di XiaoLi wrote:<br> <blockquote class="mmbqc1">hi, Cyborg and nova team:<br> I am using cyborg with "Wallaby" release to manage my accelerator devices, while I'm trying to unbind the accelerator I found that the device was not actually unbound from the virtual machine. <br> Here are my questions:<br> 1. What is the function of the arq unbind command in cyborg ?<br></blockquote>it has two usecases.<br>it call by nova when nova is deleting or moving the vm<br>it can be used by an enduser if they are not using cybrog with nova.<br> <blockquote class="mmbqc1">2. How to unbind the accelerator which bounded to vm? Does nova or cyborg support this function now?<br> <br></blockquote>the only way to  do that for a nova instance is to resize it to a flavor that does not request the device via the<br>cyborg device profiel in the extra spec.<br><br>more recently we have started to support using cybrog for neutron nics too.<br>in this case the unbinding can be done by doing a port detach and the device should be remvoed from the vm and unbond in cybrog.<br> <blockquote class="mmbqc1"><br> Here are my steps:<br> step1: openstack accelerator arq unbind ed205084-f58d-4fad-99b4-327a1398858f<br></blockquote>this should be treated as an admin/service only oepration wehn using cybrog with nova more on that below.<br> <blockquote class="mmbqc1">+---------------------+--------------------------------------+<br> <blockquote class="mmbqc2">Field               | Value                                |<br> </blockquote>+---------------------+--------------------------------------+<br> <blockquote class="mmbqc2">uuid                | ed205084-f58d-4fad-99b4-327a1398858f |<br> state               | Unbound                              |<br> device_profile_name | ssd                                  |<br> hostname            | None                                 |<br> device_rp_uuid      | None                                 |<br> instance_uuid       | None                                 |<br> attach_handle_type  |                                      |<br> attach_handle_info  | {}                                   |<br> </blockquote>+---------------------+--------------------------------------+<br> <br>  step2: login vm and check the device, but it still here.<br> step3: stop vm and start vm, met the following error:<br> "nova.exception.AcceleratorRequestOpFailed: Failed to get accelerator requests: Cyborg returned no accelerator requests for instance ca77ef4e-421c-4c6c-9d76-7618a90ec921"<br></blockquote>that is what i would expect and is the correct behavior as you violated the contract between nova and cyborg by unbindng the arq.<br><br>when useing cyborg with nova you shoudl never use the cyborg api driectly expcit to list the devcice profiles.<br>you should treat it like placment in that regard.<br>cybrog when used with nova today is an internal service that end user should at most have read only access too list the profiles.<br><br>nova does not support cybrog device hot/cold attach or detach.<br>the only way to add or remove a device form cyborg via nova is the device profile request in the flavor.<br>so the only support opartion to change the attach device is resize to a differnt flavor.<br><br>as i said above if you are attching smartnics using cyborg via neutron then you can also attach/devatch cybrog device by attaching/detaching<br>the neutron port which contains the device profile request. note that if the deivce does not exist on the currnt host the attch will likely fail.<br>detach should more or less always work unless there is an internal errror with one of the 3 service invovled.<br> <blockquote class="mmbqc1"><br> <br></blockquote><br></blockquote><!--😀-->
</div>
</body>
</html>