[jira] [Commented] (CLOUDSTACK-10290) Config drive - only supported for secondary storage
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16480286#comment-16480286 ] ASF GitHub Bot commented on CLOUDSTACK-10290: - blueorangutan commented on issue #2651: CLOUDSTACK-10290: Introduce option to have config drives on primary storage URL: https://github.com/apache/cloudstack/pull/2651#issuecomment-390120801 @borisstoyanov a Trillian-Jenkins test job (centos7 mgmt + xenserver-71) has been kicked to run smoke tests This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Config drive - only supported for secondary storage > --- > > Key: CLOUDSTACK-10290 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10290 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) >Affects Versions: 4.11.0.0 >Reporter: Rohit Yadav >Assignee: Daan Hoogland >Priority: Major > > Userdata disk looks like this: > > > file='/mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266/configdrive.iso'/> > > > > > > > Mount is: > root# df /mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266 > Filesystem 1K-blocks > Used Available Use% Mounted on > some-nfs-server.com:/nfs/secondary/ConfigDrive/i-2-24-VM 66391040 2973696 > 63417344 5% /mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266 > > issue: where to find a primary storage for a VM that is not yet deployed. The > configdrive is created before a storage is assigned. This order of execution > must be reversed for this to work. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CLOUDSTACK-10290) Config drive - only supported for secondary storage
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16480283#comment-16480283 ] ASF GitHub Bot commented on CLOUDSTACK-10290: - borisstoyanov commented on issue #2651: CLOUDSTACK-10290: Introduce option to have config drives on primary storage URL: https://github.com/apache/cloudstack/pull/2651#issuecomment-390120657 @blueorangutan test centos7 xenserver-71 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Config drive - only supported for secondary storage > --- > > Key: CLOUDSTACK-10290 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10290 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) >Affects Versions: 4.11.0.0 >Reporter: Rohit Yadav >Assignee: Daan Hoogland >Priority: Major > > Userdata disk looks like this: > > > file='/mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266/configdrive.iso'/> > > > > > > > Mount is: > root# df /mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266 > Filesystem 1K-blocks > Used Available Use% Mounted on > some-nfs-server.com:/nfs/secondary/ConfigDrive/i-2-24-VM 66391040 2973696 > 63417344 5% /mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266 > > issue: where to find a primary storage for a VM that is not yet deployed. The > configdrive is created before a storage is assigned. This order of execution > must be reversed for this to work. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CLOUDSTACK-10290) Config drive - only supported for secondary storage
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16480343#comment-16480343 ] ASF GitHub Bot commented on CLOUDSTACK-10290: - blueorangutan commented on issue #2651: CLOUDSTACK-10290: Introduce option to have config drives on primary storage URL: https://github.com/apache/cloudstack/pull/2651#issuecomment-390051866 Trillian test result (tid-2681) Environment: xenserver-71 (x2), Advanced Networking with Mgmt server 6 Total time taken: 25488 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr2651-t2681-xenserver-71.zip Intermitten failure detected: /marvin/tests/smoke/test_certauthority_root.py Intermitten failure detected: /marvin/tests/smoke/test_dynamicroles.py Intermitten failure detected: /marvin/tests/smoke/test_hostha_simulator.py Intermitten failure detected: /marvin/tests/smoke/test_login.py Intermitten failure detected: /marvin/tests/smoke/test_outofbandmanagement_nestedplugin.py Intermitten failure detected: /marvin/tests/smoke/test_outofbandmanagement.py Intermitten failure detected: /marvin/tests/smoke/test_primary_storage.py Intermitten failure detected: /marvin/tests/smoke/test_privategw_acl.py Intermitten failure detected: /marvin/tests/smoke/test_snapshots.py Intermitten failure detected: /marvin/tests/smoke/test_templates.py Intermitten failure detected: /marvin/tests/smoke/test_usage.py Smoke tests completed. 56 look OK, 11 have error(s) Only failed tests results shown below: Test | Result | Time (s) | Test File --- | --- | --- | --- login_test_saml_user | `Error` | 0.63 | test_login.py test_revoke_certificate | `Error` | 0.01 | test_certauthority_root.py test_role_account_acls_multiple_mgmt_servers | `Error` | 0.72 | test_dynamicroles.py test_configure_ha_provider_invalid | `Error` | 0.01 | test_hostha_simulator.py test_configure_ha_provider_valid | `Error` | 0.01 | test_hostha_simulator.py test_ha_configure_enabledisable_across_clusterzones | `Error` | 0.01 | test_hostha_simulator.py test_ha_disable_feature_invalid | `Error` | 0.01 | test_hostha_simulator.py test_ha_enable_feature_invalid | `Error` | 0.01 | test_hostha_simulator.py test_ha_list_providers | `Error` | 0.01 | test_hostha_simulator.py test_ha_multiple_mgmt_server_ownership | `Error` | 0.01 | test_hostha_simulator.py test_ha_verify_fsm_available | `Error` | 0.01 | test_hostha_simulator.py test_ha_verify_fsm_degraded | `Error` | 0.01 | test_hostha_simulator.py test_ha_verify_fsm_fenced | `Error` | 0.01 | test_hostha_simulator.py test_ha_verify_fsm_recovering | `Error` | 0.01 | test_hostha_simulator.py test_hostha_configure_default_driver | `Error` | 0.01 | test_hostha_simulator.py test_hostha_configure_invalid_provider | `Error` | 0.01 | test_hostha_simulator.py test_hostha_disable_feature_valid | `Error` | 0.01 | test_hostha_simulator.py test_hostha_enable_feature_valid | `Error` | 0.01 | test_hostha_simulator.py test_hostha_enable_feature_without_setting_provider | `Error` | 0.01 | test_hostha_simulator.py test_list_ha_for_host | `Error` | 0.01 | test_hostha_simulator.py test_list_ha_for_host_invalid | `Error` | 0.01 | test_hostha_simulator.py test_list_ha_for_host_valid | `Error` | 0.01 | test_hostha_simulator.py test_02_edit_primary_storage_tags | `Error` | 0.01 | test_primary_storage.py test_oobm_issue_power_cycle | `Error` | 3.59 | test_outofbandmanagement_nestedplugin.py test_oobm_issue_power_off | `Error` | 3.40 | test_outofbandmanagement_nestedplugin.py test_oobm_issue_power_on | `Error` | 3.39 | test_outofbandmanagement_nestedplugin.py test_oobm_issue_power_reset | `Error` | 3.38 | test_outofbandmanagement_nestedplugin.py test_oobm_issue_power_soft | `Error` | 2.35 | test_outofbandmanagement_nestedplugin.py test_oobm_issue_power_status | `Error` | 2.27 | test_outofbandmanagement_nestedplugin.py test_oobm_background_powerstate_sync | `Failure` | 20.54 | test_outofbandmanagement.py test_oobm_background_powerstate_sync | `Error` | 20.55 | test_outofbandmanagement.py test_oobm_configure_default_driver | `Error` | 0.07 | test_outofbandmanagement.py test_oobm_configure_invalid_driver | `Error` | 0.08 | test_outofbandmanagement.py test_oobm_disable_feature_invalid | `Error` | 0.09 | test_outofbandmanagement.py test_oobm_disable_feature_valid | `Error` | 0.19 | test_outofbandmanagement.py test_oobm_enable_feature_invalid | `Error` | 0.10 | test_outofbandmanagement.py test_oobm_enable_feature_valid | `Error` | 1.16 | test_outofbandmanagement.py test_oobm_enabledisable_across_clusterzones | `Error` | 9.92 | test_outofbandmanagement.py test_oobm_enabledisable_across_clusterzones | `Error` | 9.93 | test_outofbandmanagement.py test_oob
[jira] [Commented] (CLOUDSTACK-10276) View volumes from primary storage not working when storage UUID is not a UUID
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16480412#comment-16480412 ] ASF GitHub Bot commented on CLOUDSTACK-10276: - DaanHoogland commented on issue #2639: [CLOUDSTACK-10276] listVolumes not working when storage UUID is not a UUID URL: https://github.com/apache/cloudstack/pull/2639#issuecomment-390152934 see if jenkins is convinced This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > View volumes from primary storage not working when storage UUID is not a UUID > - > > Key: CLOUDSTACK-10276 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10276 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) >Reporter: Rafael Weingärtner >Assignee: Rafael Weingärtner >Priority: Major > > When configuration a pre-setup primary storage we can enter the name-label of > the storage that is going to be used by ACS and is already set up in the > host. The problem is that we can use any String of characters there, and this > String does not need to be a UUID one. When listing volumes from a primary > storage that has such conditions, the list will return all of the volumes in > the cloud because the ad-hoc “API framework” will ignore that value as it is > not a UUID type. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CLOUDSTACK-10276) View volumes from primary storage not working when storage UUID is not a UUID
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16480413#comment-16480413 ] ASF GitHub Bot commented on CLOUDSTACK-10276: - rafaelweingartner opened a new pull request #2639: [CLOUDSTACK-10276] listVolumes not working when storage UUID is not a UUID URL: https://github.com/apache/cloudstack/pull/2639 ## Description When configuring a pre-setup primary storage we can enter the name-label of the storage that is going to be used by ACS and is already set up in the host. The problem is that we can use any String of characters there, and this String does not need to be a UUID. When listing volumes from a primary storage that has such conditions, the list will return all of the volumes in the cloud because the “API framework” will ignore that value as it is not a UUID type. ## Types of changes - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] New feature (non-breaking change which adds functionality) - [X] Bug fix (non-breaking change which fixes an issue) - [ ] Enhancement (improves an existing feature and functionality) - [ ] Cleanup (Code refactoring and cleanup, that may add test cases) ## How Has This Been Tested? Locally ## Checklist: - [X] I have read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/master/CONTRIBUTING.md) document. - [X] My code follows the code style of this project. - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. Testing - [ ] I have added tests to cover my changes. - [X] All relevant new and existing integration tests have passed. - [ ] A full integration testsuite with all test that can run on my environment has passed. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > View volumes from primary storage not working when storage UUID is not a UUID > - > > Key: CLOUDSTACK-10276 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10276 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) >Reporter: Rafael Weingärtner >Assignee: Rafael Weingärtner >Priority: Major > > When configuration a pre-setup primary storage we can enter the name-label of > the storage that is going to be used by ACS and is already set up in the > host. The problem is that we can use any String of characters there, and this > String does not need to be a UUID one. When listing volumes from a primary > storage that has such conditions, the list will return all of the volumes in > the cloud because the ad-hoc “API framework” will ignore that value as it is > not a UUID type. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CLOUDSTACK-10276) View volumes from primary storage not working when storage UUID is not a UUID
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16480410#comment-16480410 ] ASF GitHub Bot commented on CLOUDSTACK-10276: - DaanHoogland commented on issue #2639: [CLOUDSTACK-10276] listVolumes not working when storage UUID is not a UUID URL: https://github.com/apache/cloudstack/pull/2639#issuecomment-390152847 arguing with jenkins This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > View volumes from primary storage not working when storage UUID is not a UUID > - > > Key: CLOUDSTACK-10276 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10276 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) >Reporter: Rafael Weingärtner >Assignee: Rafael Weingärtner >Priority: Major > > When configuration a pre-setup primary storage we can enter the name-label of > the storage that is going to be used by ACS and is already set up in the > host. The problem is that we can use any String of characters there, and this > String does not need to be a UUID one. When listing volumes from a primary > storage that has such conditions, the list will return all of the volumes in > the cloud because the ad-hoc “API framework” will ignore that value as it is > not a UUID type. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CLOUDSTACK-10276) View volumes from primary storage not working when storage UUID is not a UUID
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16480411#comment-16480411 ] ASF GitHub Bot commented on CLOUDSTACK-10276: - DaanHoogland closed pull request #2639: [CLOUDSTACK-10276] listVolumes not working when storage UUID is not a UUID URL: https://github.com/apache/cloudstack/pull/2639 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/api/src/org/apache/cloudstack/api/command/admin/volume/ListVolumesCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/volume/ListVolumesCmdByAdmin.java index 5fe5bfea485..add22713931 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/volume/ListVolumesCmdByAdmin.java +++ b/api/src/org/apache/cloudstack/api/command/admin/volume/ListVolumesCmdByAdmin.java @@ -16,50 +16,15 @@ // under the License. package org.apache.cloudstack.api.command.admin.volume; -import org.apache.log4j.Logger; - -import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.api.APICommand; -import org.apache.cloudstack.api.ApiConstants; -import org.apache.cloudstack.api.Parameter; import org.apache.cloudstack.api.ResponseObject.ResponseView; import org.apache.cloudstack.api.command.user.volume.ListVolumesCmd; -import org.apache.cloudstack.api.response.PodResponse; -import org.apache.cloudstack.api.response.StoragePoolResponse; import org.apache.cloudstack.api.response.VolumeResponse; import com.cloud.storage.Volume; - -@APICommand(name = "listVolumes", description = "Lists all volumes.", responseObject = VolumeResponse.class, responseView = ResponseView.Full, entityType = {Volume.class}, -requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) +@APICommand(name = "listVolumes", description = "Lists all volumes.", responseObject = VolumeResponse.class, responseView = ResponseView.Full, entityType = { +Volume.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListVolumesCmdByAdmin extends ListVolumesCmd { -public static final Logger s_logger = Logger.getLogger(ListVolumesCmdByAdmin.class.getName()); - -@Parameter(name=ApiConstants.POD_ID, type=CommandType.UUID, entityType=PodResponse.class, -description="the pod id the disk volume belongs to") -private Long podId; - - -@Parameter(name=ApiConstants.STORAGE_ID, type=CommandType.UUID, entityType=StoragePoolResponse.class, -description="the ID of the storage pool, available to ROOT admin only", since="4.3", authorized = { RoleType.Admin }) -private Long storageId; - - -/ -/// Accessors /// -/ - - -@Override -public Long getPodId() { -return podId; -} - - -@Override -public Long getStorageId() { -return storageId; -} } diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/ListVolumesCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/ListVolumesCmd.java index 554e029fc48..c858f494fef 100644 --- a/api/src/org/apache/cloudstack/api/command/user/volume/ListVolumesCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/volume/ListVolumesCmd.java @@ -16,9 +16,8 @@ // under the License. package org.apache.cloudstack.api.command.user.volume; -import org.apache.log4j.Logger; - import java.util.List; + import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; @@ -35,11 +34,12 @@ import org.apache.cloudstack.api.response.UserVmResponse; import org.apache.cloudstack.api.response.VolumeResponse; import org.apache.cloudstack.api.response.ZoneResponse; +import org.apache.log4j.Logger; import com.cloud.storage.Volume; -@APICommand(name = "listVolumes", description = "Lists all volumes.", responseObject = VolumeResponse.class, responseView = ResponseView.Restricted, entityType = {Volume.class}, -requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) +@APICommand(name = "listVolumes", description = "Lists all volumes.", responseObject = VolumeResponse.class, responseView = ResponseView.Restricted, entityType = { +Volume.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListVolumesCmd extends BaseListTaggedResourcesCmd { public static final Logger s_logger = Logger.getLogger(ListVolumesCmd.class.getName()); @@ -55,7 +55,7 @@ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = VolumeResponse.class, d
[jira] [Commented] (CLOUDSTACK-10290) Config drive - only supported for secondary storage
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16480527#comment-16480527 ] ASF GitHub Bot commented on CLOUDSTACK-10290: - rhtyd commented on issue #2614: WIP perform config drive creation on primary storage (CLOUDSTACK-10290) URL: https://github.com/apache/cloudstack/pull/2614#issuecomment-390182316 This can be closed, new PR that is ready for review now: https://github.com/apache/cloudstack/pull/2651 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Config drive - only supported for secondary storage > --- > > Key: CLOUDSTACK-10290 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10290 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) >Affects Versions: 4.11.0.0 >Reporter: Rohit Yadav >Assignee: Daan Hoogland >Priority: Major > > Userdata disk looks like this: > > > file='/mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266/configdrive.iso'/> > > > > > > > Mount is: > root# df /mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266 > Filesystem 1K-blocks > Used Available Use% Mounted on > some-nfs-server.com:/nfs/secondary/ConfigDrive/i-2-24-VM 66391040 2973696 > 63417344 5% /mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266 > > issue: where to find a primary storage for a VM that is not yet deployed. The > configdrive is created before a storage is assigned. This order of execution > must be reversed for this to work. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CLOUDSTACK-10290) Config drive - only supported for secondary storage
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16480528#comment-16480528 ] ASF GitHub Bot commented on CLOUDSTACK-10290: - rhtyd commented on issue #2651: CLOUDSTACK-10290: Introduce option to have config drives on primary storage URL: https://github.com/apache/cloudstack/pull/2651#issuecomment-390182379 @blueorangutan package This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Config drive - only supported for secondary storage > --- > > Key: CLOUDSTACK-10290 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10290 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) >Affects Versions: 4.11.0.0 >Reporter: Rohit Yadav >Assignee: Daan Hoogland >Priority: Major > > Userdata disk looks like this: > > > file='/mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266/configdrive.iso'/> > > > > > > > Mount is: > root# df /mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266 > Filesystem 1K-blocks > Used Available Use% Mounted on > some-nfs-server.com:/nfs/secondary/ConfigDrive/i-2-24-VM 66391040 2973696 > 63417344 5% /mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266 > > issue: where to find a primary storage for a VM that is not yet deployed. The > configdrive is created before a storage is assigned. This order of execution > must be reversed for this to work. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CLOUDSTACK-10290) Config drive - only supported for secondary storage
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16480533#comment-16480533 ] ASF GitHub Bot commented on CLOUDSTACK-10290: - rhtyd commented on issue #2651: CLOUDSTACK-10290: Introduce option to have config drives on primary storage URL: https://github.com/apache/cloudstack/pull/2651#issuecomment-390183638 @blueorangutan package This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Config drive - only supported for secondary storage > --- > > Key: CLOUDSTACK-10290 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10290 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) >Affects Versions: 4.11.0.0 >Reporter: Rohit Yadav >Assignee: Daan Hoogland >Priority: Major > > Userdata disk looks like this: > > > file='/mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266/configdrive.iso'/> > > > > > > > Mount is: > root# df /mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266 > Filesystem 1K-blocks > Used Available Use% Mounted on > some-nfs-server.com:/nfs/secondary/ConfigDrive/i-2-24-VM 66391040 2973696 > 63417344 5% /mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266 > > issue: where to find a primary storage for a VM that is not yet deployed. The > configdrive is created before a storage is assigned. This order of execution > must be reversed for this to work. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CLOUDSTACK-10290) Config drive - only supported for secondary storage
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16480535#comment-16480535 ] ASF GitHub Bot commented on CLOUDSTACK-10290: - blueorangutan commented on issue #2651: CLOUDSTACK-10290: Introduce option to have config drives on primary storage URL: https://github.com/apache/cloudstack/pull/2651#issuecomment-390183714 @rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Config drive - only supported for secondary storage > --- > > Key: CLOUDSTACK-10290 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10290 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) >Affects Versions: 4.11.0.0 >Reporter: Rohit Yadav >Assignee: Daan Hoogland >Priority: Major > > Userdata disk looks like this: > > > file='/mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266/configdrive.iso'/> > > > > > > > Mount is: > root# df /mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266 > Filesystem 1K-blocks > Used Available Use% Mounted on > some-nfs-server.com:/nfs/secondary/ConfigDrive/i-2-24-VM 66391040 2973696 > 63417344 5% /mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266 > > issue: where to find a primary storage for a VM that is not yet deployed. The > configdrive is created before a storage is assigned. This order of execution > must be reversed for this to work. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CLOUDSTACK-10290) Config drive - only supported for secondary storage
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16480532#comment-16480532 ] ASF GitHub Bot commented on CLOUDSTACK-10290: - rhtyd commented on issue #2651: CLOUDSTACK-10290: Introduce option to have config drives on primary storage URL: https://github.com/apache/cloudstack/pull/2651#issuecomment-390182379 @blueorangutan package This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Config drive - only supported for secondary storage > --- > > Key: CLOUDSTACK-10290 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10290 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) >Affects Versions: 4.11.0.0 >Reporter: Rohit Yadav >Assignee: Daan Hoogland >Priority: Major > > Userdata disk looks like this: > > > file='/mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266/configdrive.iso'/> > > > > > > > Mount is: > root# df /mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266 > Filesystem 1K-blocks > Used Available Use% Mounted on > some-nfs-server.com:/nfs/secondary/ConfigDrive/i-2-24-VM 66391040 2973696 > 63417344 5% /mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266 > > issue: where to find a primary storage for a VM that is not yet deployed. The > configdrive is created before a storage is assigned. This order of execution > must be reversed for this to work. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CLOUDSTACK-10290) Config drive - only supported for secondary storage
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16480573#comment-16480573 ] ASF GitHub Bot commented on CLOUDSTACK-10290: - nvazquez commented on a change in pull request #2651: CLOUDSTACK-10290: Introduce option to have config drives on primary storage URL: https://github.com/apache/cloudstack/pull/2651#discussion_r189248769 ## File path: engine/storage/configdrive/src/org/apache/cloudstack/storage/configdrive/ConfigDriveBuilder.java ## @@ -0,0 +1,222 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package org.apache.cloudstack.storage.configdrive; + +import static com.cloud.network.NetworkModel.CONFIGDATA_CONTENT; +import static com.cloud.network.NetworkModel.CONFIGDATA_DIR; +import static com.cloud.network.NetworkModel.CONFIGDATA_FILE; +import static com.cloud.network.NetworkModel.PASSWORD_FILE; +import static com.cloud.network.NetworkModel.USERDATA_FILE; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.List; + +import org.apache.commons.codec.binary.Base64; +import org.apache.commons.io.FileUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.log4j.Logger; +import org.joda.time.Duration; + +import com.cloud.network.NetworkModel; +import com.cloud.utils.exception.CloudRuntimeException; +import com.cloud.utils.script.Script; +import com.google.common.base.Strings; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; + +public class ConfigDriveBuilder { + +public static final Logger LOG = Logger.getLogger(ConfigDriveBuilder.class); + +private static void writeFile(final File folder, final String file, final String content) { +if (folder == null || Strings.isNullOrEmpty(file)) { +return; +} +final File vendorDataFile = new File(folder, file); +try (final FileWriter fw = new FileWriter(vendorDataFile); final BufferedWriter bw = new BufferedWriter(fw)) { +bw.write(content); +} catch (IOException ex) { +throw new CloudRuntimeException("Failed to create config drive file " + file, ex); +} +} + +public static String fileToBase64String(final File isoFile) throws IOException { +byte[] encoded = Base64.encodeBase64(FileUtils.readFileToByteArray(isoFile)); +return new String(encoded, StandardCharsets.US_ASCII); +} + +public static File base64StringToFile(final String encodedIsoData, final String folder, final String fileName) throws IOException { +byte[] decoded = Base64.decodeBase64(encodedIsoData.getBytes(StandardCharsets.US_ASCII)); +Path destPath = Paths.get(folder, fileName); +return Files.write(destPath, decoded).toFile(); +} + +public static String buildConfigDrive(final List vmData, final String isoFileName, final String driveLabel) { +if (vmData == null) { +throw new CloudRuntimeException("No VM metadata provided"); +} + +Path tempDir = null; +String tempDirName = null; +try { +tempDir = Files.createTempDirectory(ConfigDrive.CONFIGDRIVEDIR); +tempDirName = tempDir.toString(); + +File openStackFolder = new File(tempDirName + ConfigDrive.openStackConfigDriveName); +if (openStackFolder.exists() || openStackFolder.mkdirs()) { +writeFile(openStackFolder, "vendor_data.json", "{}"); +writeFile(openStackFolder, "network_data.json", "{}"); +} else { +throw new CloudRuntimeException("Failed to create folder " + openStackFolder); +} + +JsonObject metaData = new JsonObject(); +for (String[] item : vmData) { Review comment: Can this logic in the FOR loop be extracted to a method?
[jira] [Commented] (CLOUDSTACK-10290) Config drive - only supported for secondary storage
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16480577#comment-16480577 ] ASF GitHub Bot commented on CLOUDSTACK-10290: - nvazquez commented on a change in pull request #2651: CLOUDSTACK-10290: Introduce option to have config drives on primary storage URL: https://github.com/apache/cloudstack/pull/2651#discussion_r189249271 ## File path: engine/storage/configdrive/src/org/apache/cloudstack/storage/configdrive/ConfigDriveBuilder.java ## @@ -0,0 +1,222 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package org.apache.cloudstack.storage.configdrive; + +import static com.cloud.network.NetworkModel.CONFIGDATA_CONTENT; +import static com.cloud.network.NetworkModel.CONFIGDATA_DIR; +import static com.cloud.network.NetworkModel.CONFIGDATA_FILE; +import static com.cloud.network.NetworkModel.PASSWORD_FILE; +import static com.cloud.network.NetworkModel.USERDATA_FILE; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.List; + +import org.apache.commons.codec.binary.Base64; +import org.apache.commons.io.FileUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.log4j.Logger; +import org.joda.time.Duration; + +import com.cloud.network.NetworkModel; +import com.cloud.utils.exception.CloudRuntimeException; +import com.cloud.utils.script.Script; +import com.google.common.base.Strings; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; + +public class ConfigDriveBuilder { + +public static final Logger LOG = Logger.getLogger(ConfigDriveBuilder.class); + +private static void writeFile(final File folder, final String file, final String content) { +if (folder == null || Strings.isNullOrEmpty(file)) { +return; +} +final File vendorDataFile = new File(folder, file); +try (final FileWriter fw = new FileWriter(vendorDataFile); final BufferedWriter bw = new BufferedWriter(fw)) { +bw.write(content); +} catch (IOException ex) { +throw new CloudRuntimeException("Failed to create config drive file " + file, ex); +} +} + +public static String fileToBase64String(final File isoFile) throws IOException { +byte[] encoded = Base64.encodeBase64(FileUtils.readFileToByteArray(isoFile)); +return new String(encoded, StandardCharsets.US_ASCII); +} + +public static File base64StringToFile(final String encodedIsoData, final String folder, final String fileName) throws IOException { +byte[] decoded = Base64.decodeBase64(encodedIsoData.getBytes(StandardCharsets.US_ASCII)); +Path destPath = Paths.get(folder, fileName); +return Files.write(destPath, decoded).toFile(); +} + +public static String buildConfigDrive(final List vmData, final String isoFileName, final String driveLabel) { +if (vmData == null) { +throw new CloudRuntimeException("No VM metadata provided"); +} + +Path tempDir = null; +String tempDirName = null; +try { +tempDir = Files.createTempDirectory(ConfigDrive.CONFIGDRIVEDIR); +tempDirName = tempDir.toString(); + +File openStackFolder = new File(tempDirName + ConfigDrive.openStackConfigDriveName); +if (openStackFolder.exists() || openStackFolder.mkdirs()) { +writeFile(openStackFolder, "vendor_data.json", "{}"); +writeFile(openStackFolder, "network_data.json", "{}"); +} else { +throw new CloudRuntimeException("Failed to create folder " + openStackFolder); +} + +JsonObject metaData = new JsonObject(); +for (String[] item : vmData) { +String dataType = item[CONFIGDATA_DIR]; +String fileName = item[CONFIGDATA_FILE]; +String conten
[jira] [Commented] (CLOUDSTACK-10290) Config drive - only supported for secondary storage
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16480578#comment-16480578 ] ASF GitHub Bot commented on CLOUDSTACK-10290: - rhtyd commented on a change in pull request #2651: CLOUDSTACK-10290: Introduce option to have config drives on primary storage URL: https://github.com/apache/cloudstack/pull/2651#discussion_r189249413 ## File path: engine/storage/configdrive/src/org/apache/cloudstack/storage/configdrive/ConfigDriveBuilder.java ## @@ -0,0 +1,222 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package org.apache.cloudstack.storage.configdrive; + +import static com.cloud.network.NetworkModel.CONFIGDATA_CONTENT; +import static com.cloud.network.NetworkModel.CONFIGDATA_DIR; +import static com.cloud.network.NetworkModel.CONFIGDATA_FILE; +import static com.cloud.network.NetworkModel.PASSWORD_FILE; +import static com.cloud.network.NetworkModel.USERDATA_FILE; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.List; + +import org.apache.commons.codec.binary.Base64; +import org.apache.commons.io.FileUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.log4j.Logger; +import org.joda.time.Duration; + +import com.cloud.network.NetworkModel; +import com.cloud.utils.exception.CloudRuntimeException; +import com.cloud.utils.script.Script; +import com.google.common.base.Strings; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; + +public class ConfigDriveBuilder { + +public static final Logger LOG = Logger.getLogger(ConfigDriveBuilder.class); + +private static void writeFile(final File folder, final String file, final String content) { +if (folder == null || Strings.isNullOrEmpty(file)) { +return; +} +final File vendorDataFile = new File(folder, file); +try (final FileWriter fw = new FileWriter(vendorDataFile); final BufferedWriter bw = new BufferedWriter(fw)) { +bw.write(content); +} catch (IOException ex) { +throw new CloudRuntimeException("Failed to create config drive file " + file, ex); +} +} + +public static String fileToBase64String(final File isoFile) throws IOException { +byte[] encoded = Base64.encodeBase64(FileUtils.readFileToByteArray(isoFile)); +return new String(encoded, StandardCharsets.US_ASCII); +} + +public static File base64StringToFile(final String encodedIsoData, final String folder, final String fileName) throws IOException { +byte[] decoded = Base64.decodeBase64(encodedIsoData.getBytes(StandardCharsets.US_ASCII)); +Path destPath = Paths.get(folder, fileName); +return Files.write(destPath, decoded).toFile(); +} + +public static String buildConfigDrive(final List vmData, final String isoFileName, final String driveLabel) { +if (vmData == null) { +throw new CloudRuntimeException("No VM metadata provided"); +} + +Path tempDir = null; +String tempDirName = null; +try { +tempDir = Files.createTempDirectory(ConfigDrive.CONFIGDRIVEDIR); +tempDirName = tempDir.toString(); + +File openStackFolder = new File(tempDirName + ConfigDrive.openStackConfigDriveName); +if (openStackFolder.exists() || openStackFolder.mkdirs()) { +writeFile(openStackFolder, "vendor_data.json", "{}"); +writeFile(openStackFolder, "network_data.json", "{}"); +} else { +throw new CloudRuntimeException("Failed to create folder " + openStackFolder); +} + +JsonObject metaData = new JsonObject(); +for (String[] item : vmData) { Review comment: To limit my effort scope, code in this class were previously in Nfs resource class. Most of the changes in this class are fro
[jira] [Commented] (CLOUDSTACK-10290) Config drive - only supported for secondary storage
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16480585#comment-16480585 ] ASF GitHub Bot commented on CLOUDSTACK-10290: - blueorangutan commented on issue #2651: CLOUDSTACK-10290: Introduce option to have config drives on primary storage URL: https://github.com/apache/cloudstack/pull/2651#issuecomment-390189628 Packaging result: ✔centos6 ✔centos7 ✖debian. JID-2065 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Config drive - only supported for secondary storage > --- > > Key: CLOUDSTACK-10290 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10290 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) >Affects Versions: 4.11.0.0 >Reporter: Rohit Yadav >Assignee: Daan Hoogland >Priority: Major > > Userdata disk looks like this: > > > file='/mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266/configdrive.iso'/> > > > > > > > Mount is: > root# df /mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266 > Filesystem 1K-blocks > Used Available Use% Mounted on > some-nfs-server.com:/nfs/secondary/ConfigDrive/i-2-24-VM 66391040 2973696 > 63417344 5% /mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266 > > issue: where to find a primary storage for a VM that is not yet deployed. The > configdrive is created before a storage is assigned. This order of execution > must be reversed for this to work. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CLOUDSTACK-10290) Config drive - only supported for secondary storage
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16480588#comment-16480588 ] ASF GitHub Bot commented on CLOUDSTACK-10290: - blueorangutan commented on issue #2651: CLOUDSTACK-10290: Introduce option to have config drives on primary storage URL: https://github.com/apache/cloudstack/pull/2651#issuecomment-390189980 @rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Config drive - only supported for secondary storage > --- > > Key: CLOUDSTACK-10290 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10290 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) >Affects Versions: 4.11.0.0 >Reporter: Rohit Yadav >Assignee: Daan Hoogland >Priority: Major > > Userdata disk looks like this: > > > file='/mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266/configdrive.iso'/> > > > > > > > Mount is: > root# df /mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266 > Filesystem 1K-blocks > Used Available Use% Mounted on > some-nfs-server.com:/nfs/secondary/ConfigDrive/i-2-24-VM 66391040 2973696 > 63417344 5% /mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266 > > issue: where to find a primary storage for a VM that is not yet deployed. The > configdrive is created before a storage is assigned. This order of execution > must be reversed for this to work. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CLOUDSTACK-10290) Config drive - only supported for secondary storage
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16480587#comment-16480587 ] ASF GitHub Bot commented on CLOUDSTACK-10290: - rhtyd commented on issue #2651: CLOUDSTACK-10290: Introduce option to have config drives on primary storage URL: https://github.com/apache/cloudstack/pull/2651#issuecomment-390189812 @blueorangutan test This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Config drive - only supported for secondary storage > --- > > Key: CLOUDSTACK-10290 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10290 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) >Affects Versions: 4.11.0.0 >Reporter: Rohit Yadav >Assignee: Daan Hoogland >Priority: Major > > Userdata disk looks like this: > > > file='/mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266/configdrive.iso'/> > > > > > > > Mount is: > root# df /mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266 > Filesystem 1K-blocks > Used Available Use% Mounted on > some-nfs-server.com:/nfs/secondary/ConfigDrive/i-2-24-VM 66391040 2973696 > 63417344 5% /mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266 > > issue: where to find a primary storage for a VM that is not yet deployed. The > configdrive is created before a storage is assigned. This order of execution > must be reversed for this to work. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CLOUDSTACK-10290) Config drive - only supported for secondary storage
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16480738#comment-16480738 ] ASF GitHub Bot commented on CLOUDSTACK-10290: - DaanHoogland closed pull request #2614: WIP perform config drive creation on primary storage (CLOUDSTACK-10290) URL: https://github.com/apache/cloudstack/pull/2614 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/api/src/com/cloud/network/NetworkModel.java b/api/src/com/cloud/network/NetworkModel.java index 35a6a63a992..943efac5ba2 100644 --- a/api/src/com/cloud/network/NetworkModel.java +++ b/api/src/com/cloud/network/NetworkModel.java @@ -73,7 +73,7 @@ AVAILABILITY_ZONE_FILE, "availability_zone", LOCAL_HOSTNAME_FILE, "hostname", VM_ID_FILE, "uuid", -INSTANCE_ID_FILE, "name" +PUBLIC_HOSTNAME_FILE, "name" ); static final ConfigKey MACIdentifier = new ConfigKey("Advanced",Integer.class, "mac.identifier", "0", diff --git a/config-drive/pom.xml b/config-drive/pom.xml new file mode 100644 index 000..ea8c5b6710a --- /dev/null +++ b/config-drive/pom.xml @@ -0,0 +1,71 @@ + +http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd";> + 4.0.0 + cloud-config-drive + Apache CloudStack Config-Drive Component + +org.apache.cloudstack +cloudstack +4.11.1.0-SNAPSHOT +../pom.xml + + + + org.apache.cloudstack + cloud-api + ${project.version} + + + org.apache.cloudstack + cloud-core + ${project.version} + + + log4j + log4j + + + + +src/main/java +src/test/java +target/classes +target/test-classes + + +src/main/resources + + + + +src/test/resources + + + + +org.apache.maven.plugins +maven-jar-plugin + + + + test-jar + + + + + +org.apache.maven.plugins +maven-surefire-plugin + + + + diff --git a/config-drive/src/main/java/org/apache/cloudstack/storage/ConfigDriveFactory.java b/config-drive/src/main/java/org/apache/cloudstack/storage/ConfigDriveFactory.java new file mode 100644 index 000..0d8cfa3bf2a --- /dev/null +++ b/config-drive/src/main/java/org/apache/cloudstack/storage/ConfigDriveFactory.java @@ -0,0 +1,425 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.storage; + + +import com.cloud.agent.api.Answer; +import com.cloud.agent.api.HandleConfigDriveIsoCommand; +import com.cloud.agent.api.to.DataStoreTO; +import com.cloud.agent.api.to.NfsTO; +import com.cloud.network.NetworkModel; +import com.cloud.utils.exception.CloudRuntimeException; +import com.cloud.utils.script.Script; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.io.Files; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import org.apache.commons.io.FileUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.log4j.Logger; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.nio.charset.Charset; +import java.nio.file.Path; +import java.util.List; +import java.util.Map; +import javax.naming.ConfigurationException; + +import static com.cloud.network.NetworkModel.CONFIGDATA_CONTENT; +import static com.cloud.network.NetworkModel.CONFIGDATA_DIR; +import static com.cloud.network.NetworkModel.CONFIGDATA_FILE; + +import static com.cloud.network.NetworkModel.METATDATA_DIR; +import static com.cloud.network.NetworkModel.PASSWORD_DIR; +import static com
[jira] [Commented] (CLOUDSTACK-10290) Config drive - only supported for secondary storage
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16480745#comment-16480745 ] ASF GitHub Bot commented on CLOUDSTACK-10290: - blueorangutan commented on issue #2651: CLOUDSTACK-10290: Introduce option to have config drives on primary storage URL: https://github.com/apache/cloudstack/pull/2651#issuecomment-390229293 Trillian test result (tid-2685) Environment: xenserver-71 (x2), Advanced Networking with Mgmt server 7 Total time taken: 24381 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr2651-t2685-xenserver-71.zip Intermitten failure detected: /marvin/tests/smoke/test_deploy_vm_iso.py Intermitten failure detected: /marvin/tests/smoke/test_privategw_acl.py Smoke tests completed. 66 look OK, 1 have error(s) Only failed tests results shown below: Test | Result | Time (s) | Test File --- | --- | --- | --- test_03_vpc_privategw_restart_vpc_cleanup | `Error` | 195.54 | test_privategw_acl.py This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Config drive - only supported for secondary storage > --- > > Key: CLOUDSTACK-10290 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10290 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) >Affects Versions: 4.11.0.0 >Reporter: Rohit Yadav >Assignee: Daan Hoogland >Priority: Major > > Userdata disk looks like this: > > > file='/mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266/configdrive.iso'/> > > > > > > > Mount is: > root# df /mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266 > Filesystem 1K-blocks > Used Available Use% Mounted on > some-nfs-server.com:/nfs/secondary/ConfigDrive/i-2-24-VM 66391040 2973696 > 63417344 5% /mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266 > > issue: where to find a primary storage for a VM that is not yet deployed. The > configdrive is created before a storage is assigned. This order of execution > must be reversed for this to work. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CLOUDSTACK-10290) Config drive - only supported for secondary storage
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16481403#comment-16481403 ] ASF GitHub Bot commented on CLOUDSTACK-10290: - blueorangutan commented on issue #2651: CLOUDSTACK-10290: Introduce option to have config drives on primary storage URL: https://github.com/apache/cloudstack/pull/2651#issuecomment-390368624 Trillian test result (tid-2689) Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7 Total time taken: 45321 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr2651-t2689-kvm-centos7.zip Intermitten failure detected: /marvin/tests/smoke/test_deploy_virtio_scsi_vm.py Intermitten failure detected: /marvin/tests/smoke/test_privategw_acl.py Intermitten failure detected: /marvin/tests/smoke/test_vm_life_cycle.py Intermitten failure detected: /marvin/tests/smoke/test_vpc_redundant.py Intermitten failure detected: /marvin/tests/smoke/test_vpc_router_nics.py Intermitten failure detected: /marvin/tests/smoke/test_vpc_vpn.py Intermitten failure detected: /marvin/tests/smoke/test_hostha_kvm.py Smoke tests completed. 62 look OK, 5 have error(s) Only failed tests results shown below: Test | Result | Time (s) | Test File --- | --- | --- | --- ContextSuite context=TestDeployVirtioSCSIVM>:setup | `Error` | 0.00 | test_deploy_virtio_scsi_vm.py test_03_vpc_privategw_restart_vpc_cleanup | `Failure` | 267.73 | test_privategw_acl.py test_04_rvpc_privategw_static_routes | `Failure` | 430.96 | test_privategw_acl.py test_02_not_secured_vm_migration | `Error` | 82.78 | test_vm_life_cycle.py test_03_secured_to_nonsecured_vm_migration | `Error` | 7.21 | test_vm_life_cycle.py test_04_nonsecured_to_secured_vm_migration | `Error` | 56.18 | test_vm_life_cycle.py test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL | `Failure` | 541.73 | test_vpc_redundant.py test_02_redundant_VPC_default_routes | `Failure` | 359.32 | test_vpc_redundant.py test_02_VPC_default_routes | `Failure` | 283.54 | test_vpc_router_nics.py This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Config drive - only supported for secondary storage > --- > > Key: CLOUDSTACK-10290 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10290 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) >Affects Versions: 4.11.0.0 >Reporter: Rohit Yadav >Assignee: Daan Hoogland >Priority: Major > > Userdata disk looks like this: > > > file='/mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266/configdrive.iso'/> > > > > > > > Mount is: > root# df /mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266 > Filesystem 1K-blocks > Used Available Use% Mounted on > some-nfs-server.com:/nfs/secondary/ConfigDrive/i-2-24-VM 66391040 2973696 > 63417344 5% /mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266 > > issue: where to find a primary storage for a VM that is not yet deployed. The > configdrive is created before a storage is assigned. This order of execution > must be reversed for this to work. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CLOUDSTACK-10290) Config drive - only supported for secondary storage
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16481473#comment-16481473 ] ASF GitHub Bot commented on CLOUDSTACK-10290: - rhtyd commented on issue #2651: CLOUDSTACK-10290: Introduce option to have config drives on primary storage URL: https://github.com/apache/cloudstack/pull/2651#issuecomment-390379931 @blueorangutan test This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Config drive - only supported for secondary storage > --- > > Key: CLOUDSTACK-10290 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10290 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) >Affects Versions: 4.11.0.0 >Reporter: Rohit Yadav >Assignee: Daan Hoogland >Priority: Major > > Userdata disk looks like this: > > > file='/mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266/configdrive.iso'/> > > > > > > > Mount is: > root# df /mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266 > Filesystem 1K-blocks > Used Available Use% Mounted on > some-nfs-server.com:/nfs/secondary/ConfigDrive/i-2-24-VM 66391040 2973696 > 63417344 5% /mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266 > > issue: where to find a primary storage for a VM that is not yet deployed. The > configdrive is created before a storage is assigned. This order of execution > must be reversed for this to work. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CLOUDSTACK-10290) Config drive - only supported for secondary storage
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16481474#comment-16481474 ] ASF GitHub Bot commented on CLOUDSTACK-10290: - blueorangutan commented on issue #2651: CLOUDSTACK-10290: Introduce option to have config drives on primary storage URL: https://github.com/apache/cloudstack/pull/2651#issuecomment-390379963 @rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Config drive - only supported for secondary storage > --- > > Key: CLOUDSTACK-10290 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10290 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) >Affects Versions: 4.11.0.0 >Reporter: Rohit Yadav >Assignee: Daan Hoogland >Priority: Major > > Userdata disk looks like this: > > > file='/mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266/configdrive.iso'/> > > > > > > > Mount is: > root# df /mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266 > Filesystem 1K-blocks > Used Available Use% Mounted on > some-nfs-server.com:/nfs/secondary/ConfigDrive/i-2-24-VM 66391040 2973696 > 63417344 5% /mnt/eba12ff3-c3a6-394a-bf0f-23291f1f6266 > > issue: where to find a primary storage for a VM that is not yet deployed. The > configdrive is created before a storage is assigned. This order of execution > must be reversed for this to work. -- This message was sent by Atlassian JIRA (v7.6.3#76005)