Hi Santhosh, These are new test cases. On simulator and in same test case, I have created tags on various resources like volume, project, snapshot etc and they work perfectly fine. I face this issue only for ISO and Template resource tag creation.
Thanks, Namita On Tue, Jun 3, 2014 at 6:16 PM, Santhosh Edukulla < santhosh.eduku...@citrix.com> wrote: > Namita, > > 1. Just to separate this issue as simulator vs test code, can we just > check from UI whether the objective of creating tags for simulator is > possible there? If yes, then we can look in to test code. > > 2. As well, are these new tests or existing tests? > > Thanks! > Santhosh > ________________________________________ > From: Namita Chaudhari [namita.chaudh...@sungardas.com] > Sent: Tuesday, June 03, 2014 8:27 AM > To: dev@cloudstack.apache.org > Subject: [ACS4.4] [Issue] Unable to create a resource tag on ISO and > Template resource > > Hi All, > > I was trying to create a resource tag on ISO and Template with a sample > data for a test > case. Can anyone help me toknow is there anything I'm missing in the input > parameters ? > > For both resources, I get a db exception "Out of range value for column > 'domain_id' at row 1" where the domainid gets value as -1. > > I'm running this test on simulator. > > 1] For ISO: > > a) ISO in json > > > iso1A": { > "displaytext": "Dummy ISO", > "name": "Dummy ISO", > "url": "http://people.apache.org/~tsp/dummy.iso", > "zoneid": "9ecf9d8b-cf18-4322-a641-a1c0aced5857", > # Source URL where ISO is located > "isextractable": True, > "isfeatured": True, > "ispublic": False, > "ostype": 'CentOS 5.3 (64-bit)', > "mode": 'HTTP_DOWNLOAD', > # Used in Extract template, value must be HTTP_DOWNLOAD > }, > > > b) Creating an iso with its tag > > > self.account_1A = Account.create( > > self.apiclient, > > self.services["account1A"], > > admin=False, > > domainid=self.domain_1.id< > http://self.domain_1.id/> > > ) > > > self.userapiclient_1A = > > self.testClient.getUserApiClient(self.user_1A.username, > > self.domain_1.name<http://self.domain_1.name/>) > > > > > self.iso1A = Iso.create( > self.apiclient, > self.services["iso"], > account=self.account_1A.name< > http://self.account_1A.name>, > domainid=self.account_1A.domainid > ) > self.debug("ISO created with ID: %s" % self.iso1A.id< > http://self.iso1A.id>) > > self.debug("Creating a tag for the ISO1A") > self.resource_tag_1A = Tag.create( > self.apiclient, > resourceIds=self.iso1A.id<http://self.iso1A.id>, > resourceType='iso', > tags={'OS': 'CentOS'} > > > ) > > 2] For Template : > > > a) Template in json > > "template1A": { > "displaytext": "Cent OS Template", > "name": "Cent OS Template", > "ostype": 'CentOS 5.3 (64-bit)', > "templatefilter": 'self', > }, > > b ) Create template with tag. > > try: > self.debug("Stopping the virtual machine: %s" % > self.virtual_machine_1A.name<http://self.virtual_machine_1A.name>) > #Stop virtual machine > self.virtual_machine_1A.stop(self.apiclient) > except Exception as e: > self.fail("Failed to stop VM: %s" % e) > > timeout = self.services["timeout"] > while True: > list_volume = Volume.list( > self.apiclient, > virtualmachineid= > self.virtual_machine_1A.id<http://self.virtual_machine_1A.id>, > type='ROOT', > listall=True > ) > if isinstance(list_volume, list): > break > elif timeout == 0: > raise Exception("List volumes failed.") > > time.sleep(5) > timeout = timeout - 1 > > self.volumeT = list_volume[0] > > self.template1A = Template.create( > self.apiclient, > self.services["template1A"], > self.volumeT.id<http://self.volumeT.id > > > ) > > self.debug("Created the template1A(%s). Now restarting the userVm: > %s" % (self.template1A.name<http://self.template1A.name>, > self.virtual_machine_1A.name<http://self.virtual_machine_1A.name>)) > > self.virtual_machine_1A.start(self.apiclient) > > self.debug("Creating a tag for the template1A") > self.resource_tag_1A = Tag.create( > self.apiclient, > resourceIds=self.template1A.id< > http://self.template1A.id>, > resourceType='Template', > tags={'OS': 'CentOS'} > ) > > Thanks and Regards, > -- > > Namita Chaudhari ● Engineer - Product Development ● SunGard Availability > Services, India. ● 2nd Floor, Wing 4, Cluster D, MIDC Kharadi Knowledge > Park, Pune - 411 014 ● Email: namita.chaudh...@sungardas.com<mailto: > namita.chaudh...@sungard.com> ● www.sungardas.in<http://www.sungardas.in> > > [ > http://tools.sungardas.com/Sungard-Email-Signature/ASLogo_Email_Signature.jpg > ] > > [Description: cid:image019.png@01CF48EC.6617C7F0] [Description: > cid:image020.png@01CF48EC.6617C7F0] [Description: > cid:image021.png@01CF48EC.6617C7F0] [Description: > cid:image022.png@01CF48EC.6617C7F0] [Description: > cid:image023.png@01CF48EC.6617C7F0] [Description: > cid:image024.png@01CF48EC.6617C7F0] > > > -- *Namita Chaudhari* ● Engineer - Product Development ● SunGard Availability Services, India. ● 2nd Floor, Wing 4, Cluster D, MIDC Kharadi Knowledge Park, Pune - 411 014 ● Email: namita.chaudh...@sungardas.com <namita.chaudh...@sungard.com> ● www.sungardas.in [image: Description: cid:image019.png@01CF48EC.6617C7F0] [image: Description: cid:image020.png@01CF48EC.6617C7F0] [image: Description: cid:image021.png@01CF48EC.6617C7F0] [image: Description: cid:image022.png@01CF48EC.6617C7F0] [image: Description: cid:image023.png@01CF48EC.6617C7F0] [image: Description: cid:image024.png@01CF48EC.6617C7F0]