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

Multiple SCSI controller for vsphere-clone #11091

Closed
mayankbatra123 opened this issue Jun 15, 2021 · 5 comments
Closed

Multiple SCSI controller for vsphere-clone #11091

mayankbatra123 opened this issue Jun 15, 2021 · 5 comments

Comments

@mayankbatra123
Copy link

mayankbatra123 commented Jun 15, 2021

Overview of the Issue

So vshpere-clone module of packer allows us to add storage configurations for adding multiple disks.
But it also add another scsi controller which is not required in all use cases.
Need an additional option to add multiple disk to default disk_controller rather than creating a new.
disk_controller = "scsi0" //example

Reproduction Steps

Add Storage configuration block to vshpere-clone module

Similar to this -

 disk_controller_type = ["pvscsi"]
  storage {
    disk_size             = var.secondary_storage.disk_size
    disk_thin_provisioned = var.secondary_storage.disk_thin_provisioned
    disk_eagerly_scrub    = var.secondary_storage.disk_eagerly_scrub
    disk_controller_index = var.secondary_storage.disk_controller_index
  }

Packer version

v1.7.2

Simplified Packer Buildfile

source "vsphere-clone" "vm-base" {
  vcenter_server      = "${var.vcenter_server}"
  datacenter          = "${var.vcenter_datacenter}"
  insecure_connection = "${var.vcenter_insecure_connection}"
  username            = "${var.vsphere_username}"
  password            = "${var.vsphere_password}"

  vm_name             = "${local.target_vm_tag}"
  template            = "${local.upstream_vm_tag}"
  folder              = "${var.target_vm_folder}"
  cluster             = "${var.target_vm_cluster}"
  datastore           = "${var.target_vm_datastore}"
  resource_pool       = "${var.target_vm_resource_pool}"
  
  **disk_controller_type = ["pvscsi"]**

  CPUs                = "${var.vm_cpus}"
  RAM                 = "${var.vm_ram_mb}"
  NestedHV            = true
  convert_to_template = "${var.vm_generate_template}"
  create_snapshot     = "${var.vm_create_snapshot}"
  linked_clone        = "${var.vm_linked_clone}"

  ssh_password        = "${var.ssh_password}"
  ssh_username        = "${var.ssh_username}"
  storage {
    disk_size             = var.secondary_storage.disk_size
    disk_thin_provisioned = var.secondary_storage.disk_thin_provisioned
    disk_eagerly_scrub    = var.secondary_storage.disk_eagerly_scrub
    disk_controller_index = var.secondary_storage.disk_controller_index
  }
}

Operating system and Environment details

Ubuntu- 20.4

The above configuration does create an additional disk along with another scsi controller.
If I remove the disk_controller_type from above configuration it throws an error.

It would be great to add an additional parameter to the configuration such as:
disk_controller = "scsi0" // just for example

This will allow the new disk to be mapped to default scsi controller rather than creating a new one.
Current--> 0:0, 1:0 -- Expected --> 0:0,0:1

@SwampDragons
Copy link
Contributor

SwampDragons commented Jun 23, 2021

Hi, thanks for reaching out! I think this should be settable via the disk_controller_index. Can you let me know if that solves the issue you're facing?

@mayankbatra123
Copy link
Author

mayankbatra123 commented Jun 24, 2021

Thanks for extending support. But the issue persists.
These are the values I am using right now for adding secondary disk :

secondary_storage = {
  disk_size             = 8192
  disk_thin_provisioned = true
  disk_eagerly_scrub    = false
  disk_controller_index = 0
}

So disk_controller_index is set to 0 but still it creates another scsi controller as 1:0 [Disk2] and not using default one.
May be the issue is while adding disk in vsphere-clone module and not with vsphere-iso module.

@SwampDragons
Copy link
Contributor

Ok, thanks for verifying. Sounds like a bug. We will try to take a look when we can.

@ghost
Copy link

ghost commented Jun 28, 2021

This issue has been automatically migrated to hashicorp/packer-plugin-vsphere#84 because it looks like an issue with that plugin. If you believe this is not an issue with the plugin, please reply to hashicorp/packer-plugin-vsphere#84.

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 29, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants