Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support replicate /batch resources #2

Open
xi-yang opened this issue Aug 3, 2015 · 6 comments
Open

Support replicate /batch resources #2

xi-yang opened this issue Aug 3, 2015 · 6 comments
Assignees

Comments

@xi-yang
Copy link
Collaborator

xi-yang commented Aug 3, 2015

We need a way to model a group of resources with exact same properties. For example, in AWS we can create a number of EC2 instances in a batch.

This should not change the existing relationships. We should also use a common notion instead of creating multiple batch relationships.

@xi-yang
Copy link
Collaborator Author

xi-yang commented Aug 3, 2015

Solution:

  1. nml:hasService <BatchServiceURI>
  2. <BatchServiceURI>
    mrs:providesBatch
    <BatchInstanceURI> .
  3. <ResourceURI> .
    mrs:hasBatch
    <BatchInstanceURI>
  4. <BatchInstanceURI>
    mrs:batchRule <batchRule1> .

<batchRule1>
mrs:type "number" ;
mrs:value "10" .

or

<batchRule2>
mrs:type "name:regex" ; // or "name:list"
mrs:value "regex or comma-separated-list" .

@xi-yang
Copy link
Collaborator Author

xi-yang commented Aug 3, 2015

Alternatively, do not use BatchService but simply let Resource mrs:hasBatch.
Then the batch has the following properties:
mrs:batch_number "10" ;
mrs:batch_rule "name:regex:^abc[0-9]$" . // or "name:list:abc0,abc1,abc2".

@muzcategui1106 muzcategui1106 self-assigned this Sep 11, 2015
@muzcategui1106
Copy link

I have added a new class called BatchResourcesTool and implemented the following method addBatchToModel which will create a copy of a delta model and do the following:

  1. the code will look at resources with the property mrs:hasBatch and it will find the number of batches to be created

  2. it will create new resources with the same properties as the parent, the name of these new resources will be resource name + "batch" + n where n is just a number. These new resources might be linked to resources that are batch resources as well, meaning that new statements might be one to one or one to many.

  3. After batch resources and their statements are added to the copy of the delta model, I removed the old resource which had the original mrs:hasBatch statement to avoid interference while pushing.

This was tested with creating multiple VMs at once where root volumes and network interfaces have to be batched as well.

@muzcategui1106
Copy link

While the code works for push(add) it has not been tested for push(delete) since I need to first come up with a solution on how to pull multiple resources. The current solution works at a model level, so it should work for any driver and any type of resources.

Current problems:

  1. Figuring out a way to model batch resources when pulling
  2. Push non-batch resources related with batch resources

@xi-yang
Copy link
Collaborator Author

xi-yang commented Sep 20, 2015

Miguel,
Can you create an issue in VersaStack repo and move your comments there?

@muzcategui1106
Copy link

Mr Yang
How are you?

I opened the issue on the versaStack an include you in it. Tomorrow, I have
to meet with a professor and classmates for a presentation during the
morning. I was wondering if it is ok if I work from the university
tomorrow. I would come to the office Tuesday Wednesday and Thursday. Please
let me know if it is ok.

I hope you have a good Sunday.

Sincerely,
Miguel Uzcategui

On Sun, Sep 20, 2015 at 10:54 AM, xi-yang notifications@github.com wrote:

Miguel,
Can you create an issue in VersaStack repo and move your comments there?


Reply to this email directly or view it on GitHub
#2 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants