Skip to content

how to set the stemcell default cpi upload location #345

@l-dimitrov

Description

@l-dimitrov

Hi Team, I am faced with the following problem. We have a regional restriction in our setup and I cannot seem to setup the cpi to upload the stemcell image to any other location / region than the default (us) Here is a part of the task's debug log:

I, [2024-03-19T09:15:54.756885 #94222] [task:851] INFO -- DirectorJobRunner: Uploading stemcell bosh-google-kvm-ubuntu-jammy-go_agent/1.390 to the cloud
D, [2024-03-19T09:15:54.757139 #94222] [task:851] DEBUG -- DirectorJobRunner: [external-cpi] [cpi-775101] request: {"method":"create_stemcell","arguments":["/var/vcap/data/director/tmp/stemcell20240319-94222-3v0wam/image",{"name":"bosh-google-kvm-ubuntu-jammy-go_agent","version":"1.390","infrastructure":"google","hypervisor":"kvm","disk":5120,"disk_format":"rawdisk","container_format":"bare","os_type":"linux","os_distro":"ubuntu","architecture":"x86_64","root_device_name":"/dev/sda1"}],"context":{"director_uuid":"","request_id":"cpi-775101"},"api_version":2} with command: /var/vcap/jobs/google_cpi/bin/cpi
D, [2024-03-19T09:16:05.222593 #94222] [task:851] DEBUG -- DirectorJobRunner: [external-cpi] [cpi-775101] response: {"result":null,"error":{"type":"Bosh::Clouds::CloudError","message":"Creating stemcell: Creating Google Storage Bucket: googleapi: Error 412: 'us' violates constraint 'constraints/gcp.resourceLocations', conditionNotMet","ok_to_retry":false},"log":"[json] 2024/03/19 09:15:54 DEBUG - Request bytes\n
***********\n{"method":"create_stemcell","arguments":["/var/vcap/data/director/tmp/stemcell20240319-94222-3v0wam/image",{"name":"bosh-google-kvm-ubuntu-jammy-go_agent","version":"1.390","infrastructure":"google","hypervisor":"kvm","disk":5120,"disk_format":"rawdisk","container_format":"bare","os_type":"linux","os_distro":"ubuntu","architecture":"x86_64","root_device_name":"/dev/sda1"}],"context":{"director_uuid":"","request_id":"cpi-775101"},"api_version":2}\n\n[json] 2024/03/19 09:15:54 DEBUG - Deserialized request\n**************\n{create_stemcell [/var/vcap/data/director/tmp/stemcell20240319-94222-3v0wam/image map[architecture:x86_64 container_format:bare disk:5120 disk_format:rawdisk hypervisor:kvm infrastructure:google name:bosh-google-kvm-ubuntu-jammy-go_agent os_distro:ubuntu os_type:linux root_device_name:/dev/sda1 version:1.390]] map[director_uuid:********* request_id:cpi-775101] %!s(int=2)}\n********************\n[GoogleImageService] 2024/03/19

09:15:54 DEBUG - Creating Google Storage Bucket with params: \u0026storage.Bucket{Acl:[]*storage.BucketAccessControl(nil), Autoclass:(*storage.BucketAutoclass)(nil), Billing:(*storage.BucketBilling)(nil), Cors:[]*storage.BucketCors(nil), CustomPlacementConfig:(*storage.BucketCustomPlacementConfig)(nil), DefaultEventBasedHold:false, DefaultObjectAcl:[]*storage.ObjectAccessControl(nil), Encryption:(*storage.BucketEncryption)(nil), Etag:"", IamConfiguration:(*storage.BucketIamConfiguration)(nil), Id:"", Kind:"", Labels:map[string]string(nil), Lifecycle:(*storage.BucketLifecycle)(nil), Location:"", LocationType:"", Logging:(*storage.BucketLogging)(nil), Metageneration:0, Name:"stemcell-cfbb01b8-deaa-4ffb-5fe7-bd55f43d80fe", Owner:(*storage.BucketOwner)(nil), ProjectNumber:0x0, RetentionPolicy:(*storage.BucketRetentionPolicy)(nil), Rpo:"", SatisfiesPZS:false, SelfLink:"", StorageClass:"", TimeCreated:"", Updated:"", Versioning:(*storage.BucketVersioning)(nil), Website:(*storage.BucketWebsite)(nil), ServerResponse:googleapi.ServerResponse{HTTPStatusCode:0, Header:http.Header(nil)}, ForceSendFields:[]string(nil), NullFields:[]string(nil)}\n"}, err: , exit_status: 0

so not sure where to set this Location:"", LocationType:""
we are using:
"name": "bosh-google-cpi",
"version": "46.0.0"
In the couud_config we set zone and VM's are being deployed in the correct region but the upload-stemcell command fails as it tries to go to default us location

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Waiting for Changes | Open for Contribution

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions