Can you show the full resource information from the offer? On Tue, Sep 10, 2019 at 6:50 AM Harold Molina-Bulla <h.mol...@tsc.uc3m.es> wrote:
> Hi everybody, > > We are implementing a Scheduler for Mesos in python, and we need to attach > a preconfigured shared volume to a new Task. The Shared volume is now > offered by the agents, we can get all information from the offer, but we do > not know how to attach this volume to a new created task. > > We are trying with the follow code: > > for off_volume in offers_disks : > volume = task.resources.add() > volume.name = "disk" > volume.type = mesos_pb2.Value.SCALAR > volume.scalar.value = off_volume.scalar.value > volume.disk.persistence.id = > off_volume.disk.persistence.id > volume.disk.volume.container_path = > off_volume.disk.volume.container_path > volume.disk.volume.mode = off_volume.disk.volume.mode > > Where offer_disks are the list of offered shared volumes (as we said > previously, this volume was created before to try to launch the Tasks, with > the field “shared” defined); task is the new task created using > mesos_pb2.TaskInfo(). > > When we try to create this new task, the system says: > > "Task uses invalid resources: Invalid DiskInfo: Persistent volumes cannot > be created from unreserved resources." > > How can I attach this shared volume to my new Task? > > Thanks in advance. > > H. > > > ---------------------------------------------------------------------------------------------------------------------- > “En una época de mentira universal, decir la verdad constituye un acto > revolucionario” > George Orwell (1984) > > ---------------------------------------------------------------------------------------------------------------------- > Recuerda: PRISM te está vigilando!!! X) > > ---------------------------------------------------------------------------------------------------------------------- > Harold Molina-Bulla > h.mol...@tsc.uc3m.es > Clave GnuPG: 189D5144 > > > > > > > >